+ ioremap-balanced-with-iounmap-drivers-scsi-seagatec.patch added to -mm tree

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

 



The patch titled

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

has been added to the -mm tree.  Its filename is

     ioremap-balanced-with-iounmap-drivers-scsi-seagatec.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: ioremap balanced with iounmap for drivers/scsi/seagate.c
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/seagate.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff -puN drivers/scsi/seagate.c~ioremap-balanced-with-iounmap-drivers-scsi-seagatec drivers/scsi/seagate.c
--- a/drivers/scsi/seagate.c~ioremap-balanced-with-iounmap-drivers-scsi-seagatec
+++ a/drivers/scsi/seagate.c
@@ -494,12 +494,19 @@ int __init seagate_st0x_detect (struct s
 	 *	if we lose our first interrupt.
 	 */
 	instance = scsi_register (tpnt, 0);
-	if (instance == NULL)
+	if (instance == NULL) {
+		iounmap(st0x_cr_sr);
+		iounmap(st0x_dr);
+		st0x_cr_sr = st0x_dr = NULL;
 		return 0;
+	}
 
 	hostno = instance->host_no;
 	if (request_irq (irq, do_seagate_reconnect_intr, IRQF_DISABLED, (controller_type == SEAGATE) ? "seagate" : "tmc-8xx", instance)) {
 		printk(KERN_ERR "scsi%d : unable to allocate IRQ%d\n", hostno, irq);
+		iounmap(st0x_cr_sr);
+		iounmap(st0x_dr);
+		st0x_cr_sr = st0x_dr = NULL;
 		return 0;
 	}
 	instance->irq = irq;
@@ -1647,6 +1654,10 @@ static int seagate_st0x_release(struct S
 {
 	if (shost->irq)
 		free_irq(shost->irq, shost);
+	if (st0x_cr_sr)
+		iounmap(st0x_cr_sr);
+	if (st0x_dr)
+		iounmap(st0x_dr);
 	release_region(shost->io_port, shost->n_io_port);
 	return 0;
 }
_

Patches currently in -mm which might be from amol@xxxxxxxxxxxxxxxxxxx are

origin.patch
ioremap-balanced-with-iounmap-drivers-scsi-zalonc.patch
ioremap-balanced-with-iounmap-drivers-scsi-sun3_scsic.patch
ioremap-balanced-with-iounmap-drivers-scsi-sun3_scsi_vmec.patch
ioremap-balanced-with-iounmap-drivers-scsi-seagatec.patch
ioremap-balanced-with-iounmap-drivers-scsi-qlogicptic.patch
ioremap-balanced-with-iounmap-drivers-scsi-nsp32c.patch
ioremap-balanced-with-iounmap-drivers-scsi-ncr53c8xxc.patch
ioremap-balanced-with-iounmap-drivers-scsi-fdomainc.patch
ioremap-balanced-with-iounmap-drivers-scsi-amiga7xxc.patch
ioremap-balanced-with-iounmap-drivers-scsi-3w-9xxxc.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux