diff options
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/cxgb4/cm.c | 10 | ||||
-rw-r--r-- | drivers/infiniband/hw/nes/nes_cm.c | 8 |
2 files changed, 12 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 006a35372b7a..92b4c2b0308b 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c @@ -1562,11 +1562,11 @@ static int import_ep(struct c4iw_ep *ep, __be32 peer_ip, struct dst_entry *dst, struct neighbour *n; int err, step; - rcu_read_lock(); - n = dst_get_neighbour_noref(dst); - err = -ENODEV; + n = dst_neigh_lookup(dst, &peer_ip); if (!n) - goto out; + return -ENODEV; + + rcu_read_lock(); err = -ENOMEM; if (n->dev->flags & IFF_LOOPBACK) { struct net_device *pdev; @@ -1614,6 +1614,8 @@ static int import_ep(struct c4iw_ep *ep, __be32 peer_ip, struct dst_entry *dst, out: rcu_read_unlock(); + neigh_release(n); + return err; } diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index da2c67db5ebb..71edfbbcce1c 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -1356,8 +1356,9 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi else netdev = nesvnic->netdev; + neigh = dst_neigh_lookup(&rt->dst, &dst_ip); + rcu_read_lock(); - neigh = dst_get_neighbour_noref(&rt->dst); if (neigh) { if (neigh->nud_state & NUD_VALID) { nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X" @@ -1384,9 +1385,12 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi neigh_event_send(neigh, NULL); } } - out: rcu_read_unlock(); + + if (neigh) + neigh_release(neigh); + ip_rt_put(rt); return rc; } |