Skip to content

Commit d6ef7d6

Browse files
Michael S. TsirkinRoland Dreier
authored andcommitted
IPoIB/cm: Don't crash if remote side uses one QP for both directions
The IPoIB CM spec allows the use of a single connection in both active->passive and passive->active directions. The current Linux code uses one connection for both directions, but if another node only uses one connection for both directions, we oops when we try to look up the passive connection. Fix by checking that qp_context is non-NULL before dereferencing it. Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent aff9e39 commit d6ef7d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/infiniband/ulp/ipoib/ipoib_cm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
370370

371371
if (!likely(wr_id & IPOIB_CM_RX_UPDATE_MASK)) {
372372
p = wc->qp->qp_context;
373-
if (time_after_eq(jiffies, p->jiffies + IPOIB_CM_RX_UPDATE_TIME)) {
373+
if (p && time_after_eq(jiffies, p->jiffies + IPOIB_CM_RX_UPDATE_TIME)) {
374374
spin_lock_irqsave(&priv->lock, flags);
375375
p->jiffies = jiffies;
376376
/* Move this entry to list head, but do

0 commit comments

Comments
 (0)