Commit 0a66ac17 authored by Johannes Thumshirn's avatar Johannes Thumshirn Committed by James Bottomley

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: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent a30c2a3b
...@@ -338,8 +338,11 @@ int mvs_ioremap(struct mvs_info *mvi, int bar, int bar_ex) ...@@ -338,8 +338,11 @@ int mvs_ioremap(struct mvs_info *mvi, int bar, int bar_ex)
res_start = pci_resource_start(pdev, bar); res_start = pci_resource_start(pdev, bar);
res_len = pci_resource_len(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; goto err_out;
}
res_flag = pci_resource_flags(pdev, bar); res_flag = pci_resource_flags(pdev, bar);
if (res_flag & IORESOURCE_CACHEABLE) if (res_flag & IORESOURCE_CACHEABLE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment