scsi: sun3x_esp: unmap registers on remove
Subsystems (2)
PATCH 1/1 scsi: sun3x_esp: unmap registers on remove
esp_sun3x_probe() maps both the ESP registers and DMA registers with ioremap(). The probe failure path unmaps both regions, but the normal remove path does not perform the corresponding cleanup.
As a result, both MMIO mappings remain allocated after the driver is removed.
Unmap the DMA and ESP register regions before releasing the SCSI host, matching the probe error path.
This issue was found by manual code inspection.
Fixes 0bb67f181834 ("[SCSI] sun3x_esp: convert to esp_scsi")
Signed-off-by Guangshuo Li <[email protected]>
--- drivers/scsi/sun3x_esp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/sun3x_esp.c +2 -1
@@ -259,7 +259,8 @@ static void esp_sun3x_remove(struct platform_device *dev)dma_free_coherent (esp->dev,16 , esp->command_block, esp->command_block_dma); - +iounmap (esp->dma_regs); +iounmap (esp->regs);scsi_host_put (esp->host); }
Signature · 1 line
2.43.0