soc: aspeed: socinfo: Add kfree for kstrdup
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Thu, 10 Aug 2023 12:31:04 +0000 (22:01 +0930)
committerArnd Bergmann <arnd@arndb.de>
Sat, 12 Aug 2023 10:12:58 +0000 (12:12 +0200)
commit6e6d847a8ce18ab2fbec4f579f682486a82d2c6b
treeeb551142bdb4ba60e22a8d90068683d10599cc97
parente4ad279ae345413d900d791f2f618d0a1cd0d791
soc: aspeed: socinfo: Add kfree for kstrdup

Add kfree() in the later error handling in order to avoid memory leak.

Fixes: e0218dca5787 ("soc: aspeed: Add soc info driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20230707021625.7727-1-jiasheng@iscas.ac.cn
Signed-off-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20230810123104.231167-1-joel@jms.id.au
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/soc/aspeed/aspeed-socinfo.c