From patchwork Wed Aug 24 09:33:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jitendra Bhivare X-Patchwork-Id: 9297335 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1169F607F0 for ; Wed, 24 Aug 2016 09:36:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01D1B28EBD for ; Wed, 24 Aug 2016 09:36:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAD0128EC2; Wed, 24 Aug 2016 09:36:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63A0D28EBD for ; Wed, 24 Aug 2016 09:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754658AbcHXJgO (ORCPT ); Wed, 24 Aug 2016 05:36:14 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:35958 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754432AbcHXJgN (ORCPT ); Wed, 24 Aug 2016 05:36:13 -0400 Received: by mail-pf0-f173.google.com with SMTP id h186so5200181pfg.3 for ; Wed, 24 Aug 2016 02:36:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Q+I6hRct81Hp3OUjXRTiKQQiVB6NNN9fMCdyAODXxys=; b=Fhfos5b0dcsfSDtUrIQ/LPgwjEg96jFGYCd9RKm/+agxkF1wHZ099yCkusogReGOHn BR8Q0N5SqX21D9nT31iZMWX/7QREQEaRAFyWwNTg40gHY1mMQ5wceD88fMZRg3DygYBU kcQIxiFnlb5UiN0UV9/Kq/KAGL9+VAFRwUgBY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Q+I6hRct81Hp3OUjXRTiKQQiVB6NNN9fMCdyAODXxys=; b=UAvKivWReGknklWlI4HVqqAZoXcj/bZcN/l4mbF22Yio7b/cru0xLj4tuuU3E7x1Do Fw8WzmS3tVX9C6fbAG+/Z8lMFmyHHvIgPLUWiOGDgKMGGrLyiWfFKSUsJj4N1eSXwPNq Hw2hw2OnUNHbAAiXy0T0qF71BaBaFi/R6XrsS6qB/tRSHLhI0wTEQjrHKvOsLkdgAm3U socJHizi1mObFi9aAfMSWySDT1lbYbdnpCNMyWSQyaP2EyFkwRieemkAobBkkUCs6sOK B4tqqZgP8E6eOGBvWs+3HMgeiQr7MvWubvqMv67WJbzZvRYTCNSyMpLVQ0YOGU2e1QVx n8qg== X-Gm-Message-State: AE9vXwPOdk7YHcOt5IP3XGUp8Fn3IxNGDChLdy3FRRSzH2p3v+XOFB3dF34DklRNlj0R+msg X-Received: by 10.98.222.67 with SMTP id h64mr724194pfg.128.1472031372182; Wed, 24 Aug 2016 02:36:12 -0700 (PDT) Received: from android.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id m24sm11922446pfi.34.2016.08.24.02.36.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Aug 2016 02:36:11 -0700 (PDT) From: Jitendra Bhivare To: christophe.jaillet@wanadoo.fr, julia.lawall@lip6.fr, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, Jitendra Bhivare Subject: [PATCH 3/3] be2iscsi: Add missing unlock for mbox_lock Date: Wed, 24 Aug 2016 15:03:15 +0530 Message-Id: <1472031195-14556-4-git-send-email-jitendra.bhivare@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472031195-14556-1-git-send-email-jitendra.bhivare@broadcom.com> References: <1472031195-14556-1-git-send-email-jitendra.bhivare@broadcom.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Julia pointed out beiscsi_boot_get_sinfo does not unlock mbox_lock on nonemb_cmd memory allocation failure. Signed-off-by: Jitendra Bhivare --- drivers/scsi/be2iscsi/be_mgmt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c index b9ff939..aebc4dd 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.c +++ b/drivers/scsi/be2iscsi/be_mgmt.c @@ -1085,8 +1085,10 @@ unsigned int beiscsi_boot_get_sinfo(struct beiscsi_hba *phba) nonemb_cmd->va = pci_alloc_consistent(phba->ctrl.pdev, sizeof(nonemb_cmd->size), &nonemb_cmd->dma); - if (!nonemb_cmd->va) + if (!nonemb_cmd->va) { + mutex_unlock(&ctrl->mbox_lock); return 0; + } req = nonemb_cmd->va; memset(req, 0, sizeof(*req));