@@ -919,6 +919,7 @@ struct ipoib_neigh *ipoib_neigh_alloc(st
if (!neigh)
return NULL;
+ neigh_hold(neighbour);
neigh->neighbour = neighbour;
neigh->dev = dev;
memset(&neigh->dgid.raw, 0, sizeof (union ib_gid));
@@ -932,6 +933,7 @@ struct ipoib_neigh *ipoib_neigh_alloc(st
void ipoib_neigh_free(struct net_device *dev, struct ipoib_neigh *neigh)
{
struct sk_buff *skb;
+ struct neighbour *neighbour = neigh->neighbour;
*to_ipoib_neigh(neigh->neighbour) = NULL;
while ((skb = __skb_dequeue(&neigh->queue))) {
++dev->stats.tx_dropped;
@@ -940,6 +942,7 @@ void ipoib_neigh_free(struct net_device
if (ipoib_cm_get(neigh))
ipoib_cm_destroy_tx(ipoib_cm_get(neigh));
kfree(neigh);
+ neigh_release(neighbour);
}
static int ipoib_neigh_setup_dev(struct net_device *dev, struct neigh_parms *parms)