From: Hannes Reinecke <hare@suse.de>
To: Johannes Thumshirn <jthumshirn@suse.de>,
"James E.J. Bottomley" <JBottomley@odin.com>
Cc: Christoph Hellwig <hch@lst.de>,
Mike Christie <michaelc@cs.wisc.edu>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Bart Van Assche <bvanassche@acm.org>,
Ben Hutchings <ben@decadent.org.uk>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mvsas: always iounmap resources
Date: Fri, 12 Jun 2015 08:31:38 +0200 [thread overview]
Message-ID: <557A7CCA.3080406@suse.de> (raw)
In-Reply-To: <1432286102-18184-1-git-send-email-jthumshirn@suse.de>
On 05/22/2015 11:15 AM, Johannes Thumshirn wrote:
> In case pci_resource_start() or pci_resource_len() reutrn 0, mvsas_ioremap
> returns without doing an iounmap() of mvi->regs_ex.
>
> Found by the cocinelle tool.
>
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---
> drivers/scsi/mvsas/mv_init.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c
> index 53030b0..04a3205 100644
> --- a/drivers/scsi/mvsas/mv_init.c
> +++ b/drivers/scsi/mvsas/mv_init.c
> @@ -339,8 +339,11 @@ int mvs_ioremap(struct mvs_info *mvi, int bar, int bar_ex)
>
> res_start = pci_resource_start(pdev, bar);
> res_len = pci_resource_len(pdev, bar);
> - if (!res_start || !res_len)
> + if (!res_start || !res_len) {
> + iounmap(mvi->regs_ex);
> + mvi->regs_ex = NULL;
> goto err_out;
> + }
>
> res_flag = pci_resource_flags(pdev, bar);
> if (res_flag & IORESOURCE_CACHEABLE)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
next prev parent reply other threads:[~2015-06-12 6:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-22 9:15 [PATCH] mvsas: always iounmap resources Johannes Thumshirn
2015-06-12 6:31 ` Hannes Reinecke [this message]
2015-06-22 7:43 ` Johannes Thumshirn
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=557A7CCA.3080406@suse.de \
--to=hare@suse.de \
--cc=JBottomley@odin.com \
--cc=ben@decadent.org.uk \
--cc=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=jthumshirn@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michaelc@cs.wisc.edu \
/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