From: Li RongQing <[email protected]>

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 <[email protected]>
---
 drivers/infiniband/hw/nes/nes_cm.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

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;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to