mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 09:16:33 +00:00
soc: aspeed: socinfo: Add kfree for kstrdup
Add kfree() in the later error handling in order to avoid memory leak.
Fixes: e0218dca57
("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>
This commit is contained in:
parent
e4ad279ae3
commit
6e6d847a8c
@ -137,6 +137,7 @@ static int __init aspeed_socinfo_init(void)
|
||||
|
||||
soc_dev = soc_device_register(attrs);
|
||||
if (IS_ERR(soc_dev)) {
|
||||
kfree(attrs->machine);
|
||||
kfree(attrs->soc_id);
|
||||
kfree(attrs->serial_number);
|
||||
kfree(attrs);
|
||||
|
Loading…
Reference in New Issue
Block a user