From patchwork Thu Jan 16 08:28:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 3497591 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2AD789F32F for ; Thu, 16 Jan 2014 08:28:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2FECC20122 for ; Thu, 16 Jan 2014 08:28:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DDE8520121 for ; Thu, 16 Jan 2014 08:28:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751552AbaAPI2P (ORCPT ); Thu, 16 Jan 2014 03:28:15 -0500 Received: from mail-bk0-f43.google.com ([209.85.214.43]:45292 "EHLO mail-bk0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751435AbaAPI2O (ORCPT ); Thu, 16 Jan 2014 03:28:14 -0500 Received: by mail-bk0-f43.google.com with SMTP id mz11so570072bkb.30 for ; Thu, 16 Jan 2014 00:28:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=oGaCJIaAukUWon2tOtJB1z8OJpQM0THaq/cXtpPG8kE=; b=M/BcBQhr/1cW7x/dDt+3hquXIsdb0f2ZWg7Kles6lLMViMAAESVvYICzdTQC04LU2k 5lqVIFptYAaMQNlJ/bmV2rukM+cxb+o4m8BVNxkANp+mXrZONsqI9XnQvlssv2hASxgF 5LIEIv5RKIF/qooatPveaIZ6zXoyOuirQ+wSHmYy/2CBi5H+U81Jp38ITcBH3yApKOJX YpZBOhcYh6NcPMsBl13n7gEqZroSsbfM0v05w8tZJ+VdMsvoc8SOoq5+i6bEjrWAZitd VdmBBP48D99EPmeYrTicZ26RzOySYsP6Mc5Cpmp+gEktKemyJurdozDybeI+7Ai0GMG0 u2hg== MIME-Version: 1.0 X-Received: by 10.204.200.138 with SMTP id ew10mr4880516bkb.34.1389860893202; Thu, 16 Jan 2014 00:28:13 -0800 (PST) Received: by 10.204.74.130 with HTTP; Thu, 16 Jan 2014 00:28:13 -0800 (PST) Date: Thu, 16 Jan 2014 16:28:13 +0800 Message-ID: Subject: [PATCH -next] IB/cm: Fix missing unlock on error in cm_init_qp_rtr_attr() From: Wei Yongjun To: roland@kernel.org, sean.hefty@intel.com, hal.rosenstock@gmail.com, matanb@mellanox.com, zhaohongjiang@huawei.com, akpm@linux-foundation.org, tj@kernel.org, ogerlitz@mellanox.com Cc: yongjun_wei@trendmicro.com.cn, linux-rdma@vger.kernel.org Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun 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 --- drivers/infiniband/core/cm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index c6d543c..0601b9d 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -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;