summaryrefslogtreecommitdiff
path: root/drivers/scsi/mvsas
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2015-05-22 11:15:02 +0200
committerJames Bottomley <JBottomley@Odin.com>2015-08-12 11:18:47 -0700
commit0a66ac17abf2bd03e30fbe20b1847258b960b683 (patch)
tree91cf9b928b94dd34894538fc97f4ef8273339ac8 /drivers/scsi/mvsas
parenta30c2a3bf8571c6748dd16edc10b32d45ed71a72 (diff)
mvsas: always iounmap resources
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> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/mvsas')
-rw-r--r--drivers/scsi/mvsas/mv_init.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c
index d40d734aa53a..f466a6aa8830 100644
--- a/drivers/scsi/mvsas/mv_init.c
+++ b/drivers/scsi/mvsas/mv_init.c
@@ -338,8 +338,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)