[PATCH] scsi: missing iounmap for mvi->regs_ex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It also need to call iounmap() when it fails to get res_start and
res_len from pci_resource_start{len}(pdev, bar).

Signed-off-by: Daeseok Youn <daeseok.youn@xxxxxxxxx>
---
 drivers/scsi/mvsas/mv_init.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c
index 53030b0..2508db2 100644
--- a/drivers/scsi/mvsas/mv_init.c
+++ b/drivers/scsi/mvsas/mv_init.c
@@ -348,15 +348,15 @@ int mvs_ioremap(struct mvs_info *mvi, int bar, int bar_ex)
 	else
 		mvi->regs = ioremap_nocache(res_start, res_len);
 
-	if (!mvi->regs) {
-		if (mvi->regs_ex && (res_flag_ex & IORESOURCE_MEM))
-			iounmap(mvi->regs_ex);
-		mvi->regs_ex = NULL;
+	if (!mvi->regs)
 		goto err_out;
-	}
 
 	return 0;
 err_out:
+	if (mvi->regs_ex && (res_flag_ex & IORESOURCE_MEM))
+		iounmap(mvi->regs_ex);
+	mvi->regs_ex = NULL;
+
 	return -1;
 }
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux