[ofa-general] [PATCH] ipoib: fix kernel Oops resulting from xmit when priv->broadcast is NULL

Jack Morgenstein jackm at dev.mellanox.co.il
Mon Nov 26 00:41:19 PST 2007


IPoIB: Fix kernel Oops resulting from xmit following dev_down.

If a port goes down, ipoib_ib_dev_down is invoked -- which flushed the mcasts (clearing
priv->broadcast) and clearing the path record cache. If ipoib_start_xmit is then invoked (before
the port is upped), a kernel Oops results from attempting to access priv->broadcast.

Returning NULL if priv->broadcast is NULL is a harmless way of bypassing the problem -- the
offending packet is simply discarded "without prejudice".

Signed-off-by: Jack Morgenstein <jackm at dev.mellanox.co.il>

---

Roland,
This fix needs to make it into 2.6.24. The Oops occurred during our testing.

- Jack

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index a03a65e..c9f6077 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -460,6 +460,9 @@ static struct ipoib_path *path_rec_create(struct net_device *dev, void *gid)
 	struct ipoib_dev_priv *priv = netdev_priv(dev);
 	struct ipoib_path *path;
 
+	if (!priv->broadcast)
+		return NULL;
+
 	path = kzalloc(sizeof *path, GFP_ATOMIC);
 	if (!path)
 		return NULL;



More information about the general mailing list