soc.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc: aspeed: socinfo: Add kfree for kstrdup
@ 2023-08-10 12:31 Joel Stanley
  2023-08-12 10:20 ` patchwork-bot+linux-soc
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Stanley @ 2023-08-10 12:31 UTC (permalink / raw)
  To: soc

From: Jiasheng Jiang <jiasheng@iscas.ac.cn>

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>
---
Hi soc maintainers, this is a low priority fix to be merged when appropriate.

 drivers/soc/aspeed/aspeed-socinfo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/aspeed/aspeed-socinfo.c b/drivers/soc/aspeed/aspeed-socinfo.c
index 1ca140356a08..3f759121dc00 100644
--- a/drivers/soc/aspeed/aspeed-socinfo.c
+++ b/drivers/soc/aspeed/aspeed-socinfo.c
@@ -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);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] soc: aspeed: socinfo: Add kfree for kstrdup
  2023-08-10 12:31 [PATCH] soc: aspeed: socinfo: Add kfree for kstrdup Joel Stanley
@ 2023-08-12 10:20 ` patchwork-bot+linux-soc
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+linux-soc @ 2023-08-12 10:20 UTC (permalink / raw)
  To: Joel Stanley; +Cc: soc

Hello:

This patch was applied to soc/soc.git (arm/fixes)
by Arnd Bergmann <arnd@arndb.de>:

On Thu, 10 Aug 2023 22:01:04 +0930 you wrote:
> From: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> 
> 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>
> 
> [...]

Here is the summary with links:
  - soc: aspeed: socinfo: Add kfree for kstrdup
    https://git.kernel.org/soc/soc/c/6e6d847a8ce1

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-12 10:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-10 12:31 [PATCH] soc: aspeed: socinfo: Add kfree for kstrdup Joel Stanley
2023-08-12 10:20 ` patchwork-bot+linux-soc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).