mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fixup! commands: devlookup: add support for cdev aliases
@ 2025-04-25  5:48 Ahmad Fatoum
  2025-04-29 15:01 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2025-04-25  5:48 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

commands: devlookup: fix memory leak in error case

There's a string_list_free after out:, which we are skipping when we
directly return.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 commands/devlookup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/commands/devlookup.c b/commands/devlookup.c
index 5877d5f1b82c..b7fd7be3b624 100644
--- a/commands/devlookup.c
+++ b/commands/devlookup.c
@@ -59,7 +59,8 @@ static int do_devlookup(int argc, char *argv[])
 		aliasbuf = string_list_join(&sl, " ");
 		if (string_list_count(&sl) > 1 && (kernelopt || paramname)) {
 			printf("Option not supported for multi cdev alias\n");
-			return COMMAND_ERROR;
+			ret = COMMAND_ERROR;
+			goto out;
 		}
 
 		if (alias) {
-- 
2.39.5




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

* Re: [PATCH] fixup! commands: devlookup: add support for cdev aliases
  2025-04-25  5:48 [PATCH] fixup! commands: devlookup: add support for cdev aliases Ahmad Fatoum
@ 2025-04-29 15:01 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-04-29 15:01 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Fri, 25 Apr 2025 07:48:39 +0200, Ahmad Fatoum wrote:
> commands: devlookup: fix memory leak in error case
> 
> There's a string_list_free after out:, which we are skipping when we
> directly return.
> 
> 

Applied, thanks!

[1/1] fixup! commands: devlookup: add support for cdev aliases
      https://git.pengutronix.de/cgit/barebox/commit/?id=d6e0dfb84eaf (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2025-04-29 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-25  5:48 [PATCH] fixup! commands: devlookup: add support for cdev aliases Ahmad Fatoum
2025-04-29 15:01 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox