2022-06-08 04:57:54

by Xiaohui Zhang

[permalink] [raw]
Subject: [PATCH 1/1] scsi: bvme6000_scsi: Fix a resource leak in bvme6000_device_remove()

Similar to the handling of zorro7xx_remove_one in commit 16ed828b872d
("scsi: zorro7xx: Fix a resource leak in zorro7xx_remove_one()"), we
thought a patch might be needed here as well.

The error handling path of the probe releases a resource that is not freed
in the remove function. In some cases, a ioremap() must be undone.

Add the missing iounmap() call in the remove function.

Signed-off-by: Xiaohui Zhang <[email protected]>
---
drivers/scsi/bvme6000_scsi.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/bvme6000_scsi.c b/drivers/scsi/bvme6000_scsi.c
index 8d72b25535c5..773254c9315b 100644
--- a/drivers/scsi/bvme6000_scsi.c
+++ b/drivers/scsi/bvme6000_scsi.c
@@ -97,6 +97,8 @@ bvme6000_device_remove(struct platform_device *dev)

scsi_remove_host(host);
NCR_700_release(host);
+ if (host->base > 0x01000000)
+ iounmap(hostdata->base);
kfree(hostdata);
free_irq(host->irq, host);

--
2.17.1