[patch 21/36] ioremap balanced with iounmap for drivers/scsi/ncr53c8xx.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Amol Lad <amol@xxxxxxxxxxxxxxxxxxx>

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

Signed-off-by: Amol Lad <amol@xxxxxxxxxxxxxxxxxxx>
Cc: James Bottomley <James.Bottomley@xxxxxxxxxxxx>
Cc: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/scsi/ncr53c8xx.c |    2 ++
 1 files changed, 2 insertions(+)

diff -puN drivers/scsi/ncr53c8xx.c~ioremap-balanced-with-iounmap-drivers-scsi-ncr53c8xxc drivers/scsi/ncr53c8xx.c
--- a/drivers/scsi/ncr53c8xx.c~ioremap-balanced-with-iounmap-drivers-scsi-ncr53c8xxc
+++ a/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;
 
_
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux