Skip to content

Commit

Permalink
IPoIB: protect child list in ipoib_ib_dev_flush
Browse files Browse the repository at this point in the history
race condition: ipoib_ib_dev_flush is accessing child list without locks.

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 Nov 29, 2005
1 parent 2e86541 commit 4f71055
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/infiniband/ulp/ipoib/ipoib_ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,13 @@ void ipoib_ib_dev_flush(void *_dev)
if (test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags))
ipoib_ib_dev_up(dev);

down(&priv->vlan_mutex);

/* Flush any child interfaces too */
list_for_each_entry(cpriv, &priv->child_intfs, list)
ipoib_ib_dev_flush(&cpriv->dev);

up(&priv->vlan_mutex);
}

void ipoib_ib_dev_cleanup(struct net_device *dev)
Expand Down

0 comments on commit 4f71055

Please sign in to comment.