mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] blspec: fix erroneus free in entry_is_of_compatible()
@ 2016-09-27  5:45 Ulrich Ölmann
  2016-09-27  6:22 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Ölmann @ 2016-09-27  5:45 UTC (permalink / raw)
  To: Barebox List

Whenever of_unflatten_dtb() encountered an error it already released the memory
before returning the error code. Make this apparent by setting the pointer to
NULL to avoid an erroneus free.

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
---
 common/blspec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/blspec.c b/common/blspec.c
index 66decb161ebd..c205d481c911 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -399,6 +399,7 @@ static bool entry_is_of_compatible(struct blspec_entry *entry)
 	root = of_unflatten_dtb(fdt);
 	if (IS_ERR(root)) {
 		ret = PTR_ERR(root);
+		root = NULL;
 		goto out;
 	}
 
-- 
2.9.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2016-09-27  6:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-27  5:45 [PATCH] blspec: fix erroneus free in entry_is_of_compatible() Ulrich Ölmann
2016-09-27  6:22 ` Sascha Hauer

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