- ioremap-balanced-with-iounmap-for-drivers-serial-8250_acorn.patch removed from -mm tree

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

 



The patch titled

     ioremap balanced with iounmap for drivers/serial/8250_acorn,c

has been removed from the -mm tree.  Its filename is

     ioremap-balanced-with-iounmap-for-drivers-serial-8250_acorn.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: ioremap balanced with iounmap for drivers/serial/8250_acorn,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: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>

Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/serial/8250_acorn.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff -puN drivers/serial/8250_acorn.c~ioremap-balanced-with-iounmap-for-drivers-serial-8250_acorn drivers/serial/8250_acorn.c
--- a/drivers/serial/8250_acorn.c~ioremap-balanced-with-iounmap-for-drivers-serial-8250_acorn
+++ a/drivers/serial/8250_acorn.c
@@ -35,6 +35,7 @@ struct serial_card_type {
 struct serial_card_info {
 	unsigned int	num_ports;
 	int		ports[MAX_PORTS];
+	void __iomem *vaddr;
 };
 
 static int __devinit
@@ -44,7 +45,6 @@ serial_card_probe(struct expansion_card 
 	struct serial_card_type *type = id->data;
 	struct uart_port port;
 	unsigned long bus_addr;
-	unsigned char __iomem *virt_addr;
 	unsigned int i;
 
 	info = kmalloc(sizeof(struct serial_card_info), GFP_KERNEL);
@@ -55,8 +55,8 @@ serial_card_probe(struct expansion_card 
 	info->num_ports = type->num_ports;
 
 	bus_addr = ecard_resource_start(ec, type->type);
-	virt_addr = ioremap(bus_addr, ecard_resource_len(ec, type->type));
-	if (!virt_addr) {
+	info->vaddr = ioremap(bus_addr, ecard_resource_len(ec, type->type));
+	if (!info->vaddr) {
 		kfree(info);
 		return -ENOMEM;
 	}
@@ -72,7 +72,7 @@ serial_card_probe(struct expansion_card 
 	port.dev	= &ec->dev;
 
 	for (i = 0; i < info->num_ports; i ++) {
-		port.membase = virt_addr + type->offset[i];
+		port.membase = info->vaddr + type->offset[i];
 		port.mapbase = bus_addr + type->offset[i];
 
 		info->ports[i] = serial8250_register_port(&port);
@@ -92,6 +92,7 @@ static void __devexit serial_card_remove
 		if (info->ports[i] > 0)
 			serial8250_unregister_port(info->ports[i]);
 
+	iounmap(info->vaddr);
 	kfree(info);
 }
 
_

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

origin.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