mtd: maps: pxa2xx-flash: fix memory leak in probe
authorZheng Yongjun <zhengyongjun3@huawei.com>
Sat, 19 Nov 2022 07:33:07 +0000 (07:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:12 +0000 (13:14 +0100)
commitf35981083cb3fc1ba6427c1543152c5e3f59d104
treeceebd9dc531b4b2963549edb85d85ba828fa703b
parent87c750affd881aceb253a3c472b2bfea568f8d2f
mtd: maps: pxa2xx-flash: fix memory leak in probe

[ Upstream commit 2399401feee27c639addc5b7e6ba519d3ca341bf ]

Free 'info' upon remapping error to avoid a memory leak.

Fixes: e644f7d62894 ("[MTD] MAPS: Merge Lubbock and Mainstone drivers into common PXA2xx driver")
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
[<miquel.raynal@bootlin.com>: Reword the commit log]
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20221119073307.22929-1-zhengyongjun3@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mtd/maps/pxa2xx-flash.c