From: Michael S. Tsirkin Date: Thu, 2 Mar 2006 19:07:47 +0000 (-0800) Subject: IPoIB: Fix multicast race between canceling and completing X-Git-Tag: v2.6.17-rc1~1180^2~17 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9acf6a8570dcfc9f55724b8b71099fc8768e8c26;p=pandora-kernel.git IPoIB: Fix multicast race between canceling and completing ipoib_mcast_stop_thread currently tests mcast->query and if it is NULL, does not perform wait_for_completion on the mcast and frees the mcast object directly. However, since both operations are done without locking, it is possible that ipoib_mcast_join_complete is in progress on this mcast object and has set mcast->query to NULL already. Solve this by: - taking priv->lock before we change mcast->query in ipoib_mcast_join_complete, and keeping it until we no longer need the mcast object - taking priv->lock around mcast->query test in ipoib_mcast_stop_thread Signed-off-by: Michael S. Tsirkin Signed-off-by: Roland Dreier --- Reading git-diff-tree failed