[ofa-general] [PATCH] ipoib/cm: compliance fix

Michael S. Tsirkin mst at dev.mellanox.co.il
Wed May 2 05:31:12 PDT 2007


IPoIB CM spec allows the use of a single connection in both active->passive and
passive->active directions.  Current code does not do this, but if the remote
ever tries to, we oops when we try to look up the passive connection.
Fix by checking qp_context before use.

Signed-off-by: Michael S. Tsirkin <mst at dev.mellanox.co.il>

---

I noticed this bug while experimenting with changes to IPoIB/CM code.
Important enough for -stable?

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 0c4e59b..1778fd6 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -370,7 +370,7 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
 
 	if (!likely(wr_id & IPOIB_CM_RX_UPDATE_MASK)) {
 		p = wc->qp->qp_context;
-		if (time_after_eq(jiffies, p->jiffies + IPOIB_CM_RX_UPDATE_TIME)) {
+		if (p && time_after_eq(jiffies, p->jiffies + IPOIB_CM_RX_UPDATE_TIME)) {
 			spin_lock_irqsave(&priv->lock, flags);
 			p->jiffies = jiffies;
 			/* Move this entry to list head, but do


-- 
MST



More information about the general mailing list