In ips_init_phase1(), most early-exit error paths use ips_abort_init(), which properly releases ioremap_ptr. However, the path where kzalloc() fails does not go through ips_abort_init() and therefore skips unmapping ioremap_ptr, leading to a potential resource leak.
Add the missing iounmap() call in this specific failure path.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Zhen Ni zhen.ni@easystack.cn --- drivers/scsi/ips.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index 94adb6ac02a4..a34167ec3038 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -6877,6 +6877,8 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) if (ha == NULL) { IPS_PRINTK(KERN_WARNING, pci_dev, "Unable to allocate temporary ha struct\n"); + if (ioremap_ptr) + iounmap(ioremap_ptr); return -1; }
linux-stable-mirror@lists.linaro.org