[patch 22/45] ioremap balanced with iounmap for drivers/scsi/fdomain.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>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/scsi/fdomain.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -puN drivers/scsi/fdomain.c~ioremap-balanced-with-iounmap-drivers-scsi-fdomainc drivers/scsi/fdomain.c
--- a/drivers/scsi/fdomain.c~ioremap-balanced-with-iounmap-drivers-scsi-fdomainc
+++ a/drivers/scsi/fdomain.c
@@ -779,7 +779,11 @@ found:
    else      printk( " FAILURE\n" );
 #endif
 
-   if (!flag) return 0;		/* iobase not found */
+   if (!flag) {
+	  if (bios_mem)
+		 iounmap(bios_mem);
+	  return 0;		/* iobase not found */
+   }
 
    *irq    = fdomain_get_irq( base );
    *iobase = base;
_
-
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