Skip to content

Commit 6e6d847

Browse files
JiangJiasarndb
authored andcommitted
soc: aspeed: socinfo: Add kfree for kstrdup
Add kfree() in the later error handling in order to avoid memory leak. Fixes: e0218dc ("soc: aspeed: Add soc info driver") Signed-off-by: Jiasheng Jiang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joel Stanley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
1 parent e4ad279 commit 6e6d847

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/soc/aspeed/aspeed-socinfo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ static int __init aspeed_socinfo_init(void)
137137

138138
soc_dev = soc_device_register(attrs);
139139
if (IS_ERR(soc_dev)) {
140+
kfree(attrs->machine);
140141
kfree(attrs->soc_id);
141142
kfree(attrs->serial_number);
142143
kfree(attrs);

0 commit comments

Comments
 (0)