parisc: ccio-dma: Add missing iounmap in error path in ccio_probe()
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 24 Aug 2022 09:36:57 +0000 (17:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 08:55:44 +0000 (10:55 +0200)
[ Upstream commit 38238be4e881a5d0abbe4872b4cd6ed790be06c8 ]

Add missing iounmap() before return from ccio_probe(), if ccio_init_resources()
fails.

Fixes: d46c742f827f ("parisc: ccio-dma: Handle kmalloc failure in ccio_init_resources()")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/parisc/ccio-dma.c

index 633762f8d7755742b261eb5aa2af5eb2cd7399a2..84a93ddcd57a20c01ca6a5e01b564dcf9d52ccdb 100644 (file)
@@ -1569,6 +1569,7 @@ static int __init ccio_probe(struct parisc_device *dev)
        ioc->ioc_regs = ioremap_nocache(dev->hpa.start, 4096);
        ccio_ioc_init(ioc);
        if (ccio_init_resources(ioc)) {
+               iounmap(ioc->ioc_regs);
                kfree(ioc);
                return -ENOMEM;
        }