From: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: Damien Le Moal <Damien.LeMoal@wdc.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH] scsi: mpt3sas: Fix unlock imbalance
Date: Thu, 2 Jul 2020 13:15:18 +0530 [thread overview]
Message-ID: <CAK=zhgrmfQgnBqmP5YC+Av0kLcjx4ZvrQ40pGJ_hmL4737x9uA@mail.gmail.com> (raw)
In-Reply-To: <SN4PR0401MB35981C2AD1B925263A35B3C59B6C0@SN4PR0401MB3598.namprd04.prod.outlook.com>
Patch looks good.
Acked-by: sreekanth reddy <sreekanth.reddy@broadcom.com>
On Wed, Jul 1, 2020 at 3:40 PM Johannes Thumshirn
<Johannes.Thumshirn@wdc.com> wrote:
>
> Looks good,
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>
> While we're at it the next block does a direct return manually unlocking
> 'ioc->pci_access_mutex' and rc is never set for any of the error paths
> in 'BRM_status_show'...
>
> Maybe we should add this one on top of your patch:
>
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
> index 62e552838565..70d2d0987249 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
> @@ -3149,20 +3149,20 @@ BRM_status_show(struct device *cdev, struct device_attribute *attr,
> }
> /* pci_access_mutex lock acquired by sysfs show path */
> mutex_lock(&ioc->pci_access_mutex);
> - if (ioc->pci_error_recovery || ioc->remove_host) {
> - mutex_unlock(&ioc->pci_access_mutex);
> - return 0;
> - }
> + if (ioc->pci_error_recovery || ioc->remove_host)
> + goto out;
>
> /* allocate upto GPIOVal 36 entries */
> sz = offsetof(Mpi2IOUnitPage3_t, GPIOVal) + (sizeof(u16) * 36);
> io_unit_pg3 = kzalloc(sz, GFP_KERNEL);
> if (!io_unit_pg3) {
> + rc = -ENOMEM;
> ioc_err(ioc, "%s: failed allocating memory for iounit_pg3: (%d) bytes\n",
> __func__, sz);
> goto out;
> }
>
> + rc = -EINVAL;
> if (mpt3sas_config_get_iounit_pg3(ioc, &mpi_reply, io_unit_pg3, sz) !=
> 0) {
> ioc_err(ioc, "%s: failed reading iounit_pg3\n",
next prev parent reply other threads:[~2020-07-02 7:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-01 8:52 [PATCH] scsi: mpt3sas: Fix unlock imbalance Damien Le Moal
2020-07-01 10:10 ` Johannes Thumshirn
2020-07-01 10:31 ` Damien Le Moal
2020-07-01 12:46 ` Johannes Thumshirn
2020-07-02 7:45 ` Sreekanth Reddy [this message]
2020-07-03 4:02 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAK=zhgrmfQgnBqmP5YC+Av0kLcjx4ZvrQ40pGJ_hmL4737x9uA@mail.gmail.com' \
--to=sreekanth.reddy@broadcom.com \
--cc=Damien.LeMoal@wdc.com \
--cc=Johannes.Thumshirn@wdc.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).