ARM: mxs: fix memory leak in mxs_machine_init()
authorZheng Yongjun <zhengyongjun3@huawei.com>
Thu, 17 Nov 2022 06:20:11 +0000 (06:20 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:40:00 +0000 (17:40 +0100)
commit290a71ff721b072356c18be0e9bfa505935463d9
tree938a954c8247ac42eebd4b1d0bfb233ae5924274
parent5c97af75f53c626283afd8a800a4bd57614f761f
ARM: mxs: fix memory leak in mxs_machine_init()

[ Upstream commit f31e3c204d1844b8680a442a48868af5ac3d5481 ]

If of_property_read_string() failed, 'soc_dev_attr' should be
freed before return. Otherwise there is a memory leak.

Fixes: 2046338dcbc6 ("ARM: mxs: Use soc bus infrastructure")
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/mach-mxs/mach-mxs.c