Skip to contentSkip to conversation

ioremap balanced with iounmap for drivers/scsi/ncr53c8xx.c

PATCH In review [email protected] 1 participant 1 message Oct 20, 2006 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 21/45 ioremap balanced with iounmap for drivers/scsi/ncr53c8xx.c

From: Amol Lad <[email protected]>

ioremap must be balanced by an iounmap and failing to do so can result in a memory leak.

---

 drivers/scsi/ncr53c8xx.c |    2 ++
 1 files changed, 2 insertions(+)
drivers/scsi/ncr53c8xx.c renamed from drivers/scsi/ncr53c8xx.c~ioremap-balanced-with-iounmap-drivers-scsi-ncr53c8xxc +2 -0
diff -puN drivers/scsi/ncr53c8xx.c~ioremap-balanced-with-iounmap-drivers-scsi-ncr53c8xxc drivers/scsi/ncr53c8xx.c
@@ -8563,6 +8563,8 @@ struct Scsi_Host * __init ncr_attach(str
 		m_free_dma(np->script0, sizeof(struct script), "SCRIPT");
 	if (np->ccb)
 		m_free_dma(np->ccb, sizeof(struct ccb), "CCB");
+	if (!device->slot.base_v && np->vaddr)
+		iounmap(np->vaddr);
 	m_free_dma(np, sizeof(struct ncb), "NCB");
 	host_data->ncb = NULL;
 

_