diff options
author | Jiri Slaby <jslaby@suse.cz> | 2016-01-12 04:49:32 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-07 01:16:21 -0500 |
commit | 1fba6a594cfd1ea0f1fc8a97e22f43def1505d74 (patch) | |
tree | 1e3c7d05a36f2f0df9140b14dda1022437a62bd1 | |
parent | 75d611bf01737d8456093804377e5cb0a60a9038 (diff) |
TTY: serial/mpsc, stop leaking mappings
When mpsc_routing_base, sdma_intr_base, mpsc_base, sdma_base, and
brg_base are mapped, they are never unmapped. The condition in the
free paths is always 'if (!XXX_base) { unmap }'. Fix it by inverting
the condition.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/mpsc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c index cadfd1cfae2b..363772992acc 100644 --- a/drivers/tty/serial/mpsc.c +++ b/drivers/tty/serial/mpsc.c | |||
@@ -1870,12 +1870,12 @@ static int mpsc_shared_map_regs(struct platform_device *pd) | |||
1870 | 1870 | ||
1871 | static void mpsc_shared_unmap_regs(void) | 1871 | static void mpsc_shared_unmap_regs(void) |
1872 | { | 1872 | { |
1873 | if (!mpsc_shared_regs.mpsc_routing_base) { | 1873 | if (mpsc_shared_regs.mpsc_routing_base) { |
1874 | iounmap(mpsc_shared_regs.mpsc_routing_base); | 1874 | iounmap(mpsc_shared_regs.mpsc_routing_base); |
1875 | release_mem_region(mpsc_shared_regs.mpsc_routing_base_p, | 1875 | release_mem_region(mpsc_shared_regs.mpsc_routing_base_p, |
1876 | MPSC_ROUTING_REG_BLOCK_SIZE); | 1876 | MPSC_ROUTING_REG_BLOCK_SIZE); |
1877 | } | 1877 | } |
1878 | if (!mpsc_shared_regs.sdma_intr_base) { | 1878 | if (mpsc_shared_regs.sdma_intr_base) { |
1879 | iounmap(mpsc_shared_regs.sdma_intr_base); | 1879 | iounmap(mpsc_shared_regs.sdma_intr_base); |
1880 | release_mem_region(mpsc_shared_regs.sdma_intr_base_p, | 1880 | release_mem_region(mpsc_shared_regs.sdma_intr_base_p, |
1881 | MPSC_SDMA_INTR_REG_BLOCK_SIZE); | 1881 | MPSC_SDMA_INTR_REG_BLOCK_SIZE); |
@@ -2011,15 +2011,15 @@ err: | |||
2011 | 2011 | ||
2012 | static void mpsc_drv_unmap_regs(struct mpsc_port_info *pi) | 2012 | static void mpsc_drv_unmap_regs(struct mpsc_port_info *pi) |
2013 | { | 2013 | { |
2014 | if (!pi->mpsc_base) { | 2014 | if (pi->mpsc_base) { |
2015 | iounmap(pi->mpsc_base); | 2015 | iounmap(pi->mpsc_base); |
2016 | release_mem_region(pi->mpsc_base_p, MPSC_REG_BLOCK_SIZE); | 2016 | release_mem_region(pi->mpsc_base_p, MPSC_REG_BLOCK_SIZE); |
2017 | } | 2017 | } |
2018 | if (!pi->sdma_base) { | 2018 | if (pi->sdma_base) { |
2019 | iounmap(pi->sdma_base); | 2019 | iounmap(pi->sdma_base); |
2020 | release_mem_region(pi->sdma_base_p, MPSC_SDMA_REG_BLOCK_SIZE); | 2020 | release_mem_region(pi->sdma_base_p, MPSC_SDMA_REG_BLOCK_SIZE); |
2021 | } | 2021 | } |
2022 | if (!pi->brg_base) { | 2022 | if (pi->brg_base) { |
2023 | iounmap(pi->brg_base); | 2023 | iounmap(pi->brg_base); |
2024 | release_mem_region(pi->brg_base_p, MPSC_BRG_REG_BLOCK_SIZE); | 2024 | release_mem_region(pi->brg_base_p, MPSC_BRG_REG_BLOCK_SIZE); |
2025 | } | 2025 | } |