mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>
Subject: [PATCH 2/4] of: free of_fixup in of_unregister_fixup()
Date: Fri, 07 Nov 2025 13:00:52 +0100	[thread overview]
Message-ID: <20251107-memleaks-v1-2-c7b74a2ae9db@pengutronix.de> (raw)
In-Reply-To: <20251107-memleaks-v1-0-c7b74a2ae9db@pengutronix.de>

The fixup is allocated in of_register_fixup(), so must be freed in
of_unregister_fixup().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/oftree.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/oftree.c b/common/oftree.c
index c22793de89fb43f3e9a6c2b0905cbf271fd7cb2b..2bf1a63e491540100839e234f891aef597fae0e0 100644
--- a/common/oftree.c
+++ b/common/oftree.c
@@ -383,6 +383,7 @@ int of_unregister_fixup(int (*fixup)(struct device_node *, void *),
 	list_for_each_entry(of_fixup, &of_fixup_list, list) {
 		if (of_fixup->fixup == fixup && of_fixup->context == context) {
 			list_del(&of_fixup->list);
+			free(of_fixup);
 			return 0;
 		}
 	}

-- 
2.47.3




  parent reply	other threads:[~2025-11-07 12:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07 12:00 [PATCH 0/4] fix some memory leaks Sascha Hauer
2025-11-07 12:00 ` [PATCH 1/4] tlv: fix memory leak Sascha Hauer
2025-11-07 12:00 ` Sascha Hauer [this message]
2025-11-07 12:00 ` [PATCH 3/4] bobject: free object name in bobject_del() Sascha Hauer
2025-11-10 13:48   ` Sascha Hauer
2025-11-07 12:00 ` [PATCH 4/4] bfetch: fix memory leak Sascha Hauer
2025-11-10 13:46 ` [PATCH 0/4] fix some memory leaks Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251107-memleaks-v1-2-c7b74a2ae9db@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox