Skip to content

Commit acd194d

Browse files
ISCAS-Vulabmartinkpetersen
authored andcommitted
scsi: sim710: Fix resource leak by adding missing ioport_unmap() calls
The driver calls ioport_map() to map I/O ports in sim710_probe_common() but never calls ioport_unmap() to release the mapping. This causes resource leaks in both the error path when request_irq() fails and in the normal device removal path via sim710_device_remove(). Add ioport_unmap() calls in the out_release error path and in sim710_device_remove(). Fixes: 56fece2 ("[PATCH] finally fix 53c700 to use the generic iomem infrastructure") Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Link: https://patch.msgid.link/20251029032555.1476-1-vulab@iscas.ac.cn Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent f6ab594 commit acd194d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/scsi/sim710.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ static int sim710_probe_common(struct device *dev, unsigned long base_addr,
133133
out_put_host:
134134
scsi_host_put(host);
135135
out_release:
136+
ioport_unmap(hostdata->base);
136137
release_region(base_addr, 64);
137138
out_free:
138139
kfree(hostdata);
@@ -148,6 +149,7 @@ static int sim710_device_remove(struct device *dev)
148149

149150
scsi_remove_host(host);
150151
NCR_700_release(host);
152+
ioport_unmap(hostdata->base);
151153
kfree(hostdata);
152154
free_irq(host->irq, host);
153155
release_region(host->base, 64);

0 commit comments

Comments
 (0)