summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Dreier2012-01-27 18:54:30 +0100
committerRoland Dreier2012-01-27 18:54:30 +0100
commit7525c85be0e6d18596390e7e2b17a206cd9777f6 (patch)
treea0d0d08527421709c65f779ca583b08ac5efdc24
parentRDMA/nes: Fix for sending MPA reject frame (diff)
downloadkernel-qcow2-linux-7525c85be0e6d18596390e7e2b17a206cd9777f6.tar.gz
kernel-qcow2-linux-7525c85be0e6d18596390e7e2b17a206cd9777f6.tar.xz
kernel-qcow2-linux-7525c85be0e6d18596390e7e2b17a206cd9777f6.zip
RDMA/nes: Add missing rcu_read_unlock() in nes_addr_resolve_neigh()
Make sure all exit paths from this function unlock everything. Reported-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 183f7ab120db..271279cccad8 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -1363,8 +1363,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
if (!memcmp(nesadapter->arp_table[arpindex].mac_addr,
neigh->ha, ETH_ALEN)) {
/* Mac address same as in nes_arp_table */
- ip_rt_put(rt);
- return rc;
+ goto out;
}
nes_manage_arp_cache(nesvnic->netdev,
@@ -1380,6 +1379,8 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
neigh_event_send(neigh, NULL);
}
}
+
+out:
rcu_read_unlock();
ip_rt_put(rt);
return rc;