From patchwork Fri Aug 26 09:39:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jitendra Bhivare X-Patchwork-Id: 9301063 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 158C2607D8 for ; Fri, 26 Aug 2016 09:40:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08B6A2951F for ; Fri, 26 Aug 2016 09:40:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0640295F8; Fri, 26 Aug 2016 09:40:24 +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 86D612951F for ; Fri, 26 Aug 2016 09:40:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752921AbcHZJjh (ORCPT ); Fri, 26 Aug 2016 05:39:37 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:36153 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752711AbcHZJjd (ORCPT ); Fri, 26 Aug 2016 05:39:33 -0400 Received: by mail-pa0-f41.google.com with SMTP id di2so25838674pad.3 for ; Fri, 26 Aug 2016 02:39:27 -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=ItaoRIS7wE2f6LPR33CrKtLoDXmGYB/q9eOGeaHGhBw=; b=JqclQtytvy4ITHCycsT4COzmP+yYuVX0YnEw29qC8Czc7xrKdOrlK7wgT7uFig4eIg wN3k2sD+EoMK3xeNR5fi3pYXrJB66EkM1DMjRXYCHjIu+6WWIgvkmJau/Ee5tlf9LC/q Iwu3Ql43vyOkCK1rl26AZFC9UElEUz2c4DveI= 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=ItaoRIS7wE2f6LPR33CrKtLoDXmGYB/q9eOGeaHGhBw=; b=cpCN36aqpPcB11lIckQfvzB1yOTuroOxzpi8NPu3NK3hQSuZU/enjfvhpEsG8+uTR7 UoEiLq7LVPsEDhwDbm2rmFcOEb+VNyaSe1oojjkQFMBooqKSDJz1moyxp4azRxp6v9gZ I0kdkT6f+fn0e59cH9HMeSanzEIhCYGPIirQ2x2taB4HV/TfbG6cYyw3FXmj8Bca6n5f QSMJlXuR9c2yPEVg7dxbR/kD40ZmHE7xVktkMcVEs1tUMLoM83IPEzYxR1ggu80EtwoO yZEEFkKA0Eh303rUrpENjBtIYxmSyoo+rUdld0WXz5bQTBE4+eRBlc2EEHHxx1xTu5Ri hThw== X-Gm-Message-State: AE9vXwNEVaU6p1Nl9D/gngbI8cmMqeYZoQAreRr6ptjKmd7bXl8eMHuWrFwDUmDF92c7glwv X-Received: by 10.66.53.234 with SMTP id e10mr4310242pap.28.1472204367188; Fri, 26 Aug 2016 02:39:27 -0700 (PDT) Received: from android.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id ty6sm27100139pac.18.2016.08.26.02.39.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Aug 2016 02:39:26 -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 v2 3/3] be2iscsi: Add missing unlock for mbox_lock Date: Fri, 26 Aug 2016 15:09:08 +0530 Message-Id: <1472204348-5960-4-git-send-email-jitendra.bhivare@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472204348-5960-1-git-send-email-jitendra.bhivare@broadcom.com> References: <1472204348-5960-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 Reviewed-by: Johannes Thumshirn --- 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));