IB/cm: Fix missing unlock on error in cm_init_qp_rtr_attr()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 16 Jan 2014 08:28:13 +0000 (16:28 +0800)
committerRoland Dreier <roland@purestorage.com>
Sun, 19 Jan 2014 23:14:04 +0000 (15:14 -0800)
Add the missing unlock before return from function cm_init_qp_rtr_attr()
in the error handling case.

Fixes: dd5f03beb4f7 ("IB/core: Ethernet L2 attributes in verbs/cm structures")
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/core/cm.c

index c6d543c3ef52b90a516d85d2b27f41f6dfc590a5..0601b9daf8407ae31c4ccc6c99ee64372a5a896f 100644 (file)
@@ -3526,8 +3526,10 @@ static int cm_init_qp_rtr_attr(struct cm_id_private *cm_id_priv,
                *qp_attr_mask = IB_QP_STATE | IB_QP_AV | IB_QP_PATH_MTU |
                                IB_QP_DEST_QPN | IB_QP_RQ_PSN;
                qp_attr->ah_attr = cm_id_priv->av.ah_attr;
-               if (!cm_id_priv->av.valid)
+               if (!cm_id_priv->av.valid) {
+                       spin_unlock_irqrestore(&cm_id_priv->lock, flags);
                        return -EINVAL;
+               }
                if (cm_id_priv->av.ah_attr.vlan_id != 0xffff) {
                        qp_attr->vlan_id = cm_id_priv->av.ah_attr.vlan_id;
                        *qp_attr_mask |= IB_QP_VID;