diff mbox

RDMA/nes: remove unnecessary RCU lock

Message ID 1418203471-14784-1-git-send-email-roy.qing.li@gmail.com (mailing list archive)
State Rejected
Headers show

Commit Message

roy.qing.li@gmail.com Dec. 10, 2014, 9:24 a.m. UTC
From: Li RongQing <roy.qing.li@gmail.com>

The neigh returned from neigh_lookup has its ref added, not need
to hold RCU lock

and move neigh_release to avoid to check if neigh is NULL again.

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 drivers/infiniband/hw/nes/nes_cm.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff mbox

Patch

diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 6f09a72..d9e3b4b 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -1510,7 +1510,6 @@  static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
 
 	neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, netdev);
 
-	rcu_read_lock();
 	if (neigh) {
 		if (neigh->nud_state & NUD_VALID) {
 			nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X"
@@ -1535,12 +1534,9 @@  static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
 		} else {
 			neigh_event_send(neigh, NULL);
 		}
-	}
 out:
-	rcu_read_unlock();
-
-	if (neigh)
 		neigh_release(neigh);
+	}
 
 	ip_rt_put(rt);
 	return rc;