lkml.org 
[lkml]   [2022]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] scsi: bvme6000_scsi: Fix a resource leak in bvme6000_device_remove()
Date
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 <xiaohuizhang@ruc.edu.cn>
---
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
\
 
 \ /
  Last update: 2022-06-07 16:53    [W:0.023 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site