Commit 65da4d81f48e092f71feaf04bf2ccd096b5a5171

Authored by Amol Lad
Committed by Linus Torvalds
1 parent af907dc8cd

[PATCH] ioremap balanced with iounmap for drivers/serial/sunsu.c

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: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: David S. Miller <davem@sunset.davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

drivers/serial/sunsu.c
... ... @@ -1499,6 +1499,9 @@
1499 1499 uart_remove_one_port(&sunsu_reg, &up->port);
1500 1500 }
1501 1501  
  1502 + if (up->port.membase)
  1503 + of_iounmap(up->port.membase, up->reg_size);
  1504 +
1502 1505 dev_set_drvdata(&dev->dev, NULL);
1503 1506  
1504 1507 return 0;