Skip to content

Commit

Permalink
IPoIB: Make sure path is fully initialized before using it
Browse files Browse the repository at this point in the history
The SA path record query completion can initialize path->pathrec.dlid
before IPoIB's callback runs and initializes path->ah, so we must test
ah rather than dlid.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Michael S. Tsirkin authored and Roland Dreier committed Jan 17, 2006
1 parent 2664b25 commit 47f7a07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/infiniband/ulp/ipoib/ipoib_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)

list_add_tail(&neigh->list, &path->neigh_list);

if (path->pathrec.dlid) {
if (path->ah) {
kref_get(&path->ah->ref);
neigh->ah = path->ah;

Expand Down Expand Up @@ -591,7 +591,7 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
return;
}

if (path->pathrec.dlid) {
if (path->ah) {
ipoib_dbg(priv, "Send unicast ARP to %04x\n",
be16_to_cpu(path->pathrec.dlid));

Expand Down

0 comments on commit 47f7a07

Please sign in to comment.