scsi: ips: Fix potential ioremap memory leak in ips_init_phase1()
Subsystems (4)
PATCH 1/1 scsi: ips: Fix potential ioremap memory leak in ips_init_phase1()
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")
Signed-off-by Zhen Ni <[email protected]>
--- drivers/scsi/ips.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/ips.c +2 -0
@@ -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 ; }
Signature · 1 line
2.20.1