]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ib/ipoib: fix illegal locking on ipoib_cm_rep_handler
authorTal Alon <talal@mellanox.com>
Mon, 8 Jul 2013 08:48:44 +0000 (11:48 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 21:45:12 +0000 (14:45 -0700)
Signed-off-by: Tal Alon <talal@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
drivers/infiniband/ulp/ipoib/ipoib_cm.c

index 316c58fb4a5ab89a1d204c26fdd24466b6b7a403..2801b8b5ce0dbe741f8a1fae9d281fd52df3ca5a 100644 (file)
@@ -966,6 +966,7 @@ static int ipoib_cm_rep_handler(struct ib_cm_id *cm_id, struct ib_cm_event *even
        struct ib_qp_attr qp_attr;
        int qp_attr_mask, ret;
        struct sk_buff *skb;
+       unsigned long flags;
 
        p->mtu = be32_to_cpu(data->mtu);
 
@@ -1003,7 +1004,7 @@ static int ipoib_cm_rep_handler(struct ib_cm_id *cm_id, struct ib_cm_event *even
 
        skb_queue_head_init(&skqueue);
 
-       spin_lock_irq(&priv->lock);
+       spin_lock_irqsave(&priv->lock, flags);
        set_bit(IPOIB_FLAG_OPER_UP, &p->flags);
        if (p->neigh)
                while ((skb = __skb_dequeue(&p->neigh->queue)))
@@ -1017,7 +1018,7 @@ static int ipoib_cm_rep_handler(struct ib_cm_id *cm_id, struct ib_cm_event *even
                                         " packet, ret:%d\n", __func__, ret);
        }
 
-       spin_unlock_irq(&priv->lock);
+       spin_unlock_irqrestore(&priv->lock, flags);
 
        ret = ib_send_cm_rtu(cm_id, NULL, 0);
        if (ret) {