diff options
author | Qinglang Miao <miaoqinglang@huawei.com> | 2020-10-28 10:15:51 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-11-19 04:50:14 +0100 |
commit | ffa1797040c5da391859a9556be7b735acbe1242 (patch) | |
tree | 68141856fee3baeab18fedb8f67a15fc259f2d50 /arch/powerpc/sysdev/mpic_msgr.c | |
parent | selftests/powerpc/eeh: disable kselftest timeout setting for eeh-basic (diff) | |
download | linux-ffa1797040c5da391859a9556be7b735acbe1242.tar.xz linux-ffa1797040c5da391859a9556be7b735acbe1242.zip |
powerpc: sysdev: add missing iounmap() on error in mpic_msgr_probe()
I noticed that iounmap() of msgr_block_addr before return from
mpic_msgr_probe() in the error handling case is missing. So use
devm_ioremap() instead of just ioremap() when remapping the message
register block, so the mapping will be automatically released on
probe failure.
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201028091551.136400-1-miaoqinglang@huawei.com
Diffstat (limited to 'arch/powerpc/sysdev/mpic_msgr.c')
-rw-r--r-- | arch/powerpc/sysdev/mpic_msgr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c index f6b253e2be40..36ec0bdd8b63 100644 --- a/arch/powerpc/sysdev/mpic_msgr.c +++ b/arch/powerpc/sysdev/mpic_msgr.c @@ -191,7 +191,7 @@ static int mpic_msgr_probe(struct platform_device *dev) /* IO map the message register block. */ of_address_to_resource(np, 0, &rsrc); - msgr_block_addr = ioremap(rsrc.start, resource_size(&rsrc)); + msgr_block_addr = devm_ioremap(&dev->dev, rsrc.start, resource_size(&rsrc)); if (!msgr_block_addr) { dev_err(&dev->dev, "Failed to iomap MPIC message registers"); return -EFAULT; |