public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 20/36] ioremap balanced with iounmap for drivers/scsi/nsp32.c
@ 2006-10-10 21:41 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2006-10-10 21:41 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, akpm, amol

From: Amol Lad <amol@verismonetworks.com>

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

Signed-off-by: Amol Lad <amol@verismonetworks.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/scsi/nsp32.c |    5 +++++
 1 files changed, 5 insertions(+)

diff -puN drivers/scsi/nsp32.c~ioremap-balanced-with-iounmap-drivers-scsi-nsp32c drivers/scsi/nsp32.c
--- a/drivers/scsi/nsp32.c~ioremap-balanced-with-iounmap-drivers-scsi-nsp32c
+++ a/drivers/scsi/nsp32.c
@@ -3540,6 +3540,11 @@ static int __devinit nsp32_probe(struct 
 
 	nsp32_dbg(NSP32_DEBUG_REGISTER, "exit %d", ret);
 
+	if (ret) {
+		iounmap(data->MmioAddress);
+		data->MmioAddress = NULL;
+	}
+
 	return ret;
 }
 
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-10 21:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-10 21:41 [patch 20/36] ioremap balanced with iounmap for drivers/scsi/nsp32.c akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox