Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/ipoib: Fix oops with ipoib_debug_mcast set

Need to set mcast->ah before debug code dereferences it.

Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by

Or Gerlitz and committed by
Roland Dreier
624d01f8 2527e681

+4 -4
+4 -4
drivers/infiniband/ulp/ipoib/ipoib_multicast.c
··· 264 264 if (!ah) { 265 265 ipoib_warn(priv, "ib_address_create failed\n"); 266 266 } else { 267 + spin_lock_irq(&priv->lock); 268 + mcast->ah = ah; 269 + spin_unlock_irq(&priv->lock); 270 + 267 271 ipoib_dbg_mcast(priv, "MGID " IPOIB_GID_FMT 268 272 " AV %p, LID 0x%04x, SL %d\n", 269 273 IPOIB_GID_ARG(mcast->mcmember.mgid), ··· 275 271 be16_to_cpu(mcast->mcmember.mlid), 276 272 mcast->mcmember.sl); 277 273 } 278 - 279 - spin_lock_irq(&priv->lock); 280 - mcast->ah = ah; 281 - spin_unlock_irq(&priv->lock); 282 274 } 283 275 284 276 /* actually send any queued packets */