summaryrefslogtreecommitdiffstats
path: root/common/blspec.c
diff options
context:
space:
mode:
authorUlrich Ölmann <u.oelmann@pengutronix.de>2016-09-27 07:45:24 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-09-27 08:22:17 +0200
commit71f6328d0093207b20ef110dffb9273cd232cba3 (patch)
tree89c14ecf7a5572197eba3ee993bff2488658990a /common/blspec.c
parentc42e8262c827d267be9529da1373efeaf535ec6b (diff)
downloadbarebox-71f6328d0093207b20ef110dffb9273cd232cba3.tar.gz
blspec: fix erroneus free in entry_is_of_compatible()
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> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/blspec.c')
-rw-r--r--common/blspec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/blspec.c b/common/blspec.c
index f02f5e9..e079e8f 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -395,6 +395,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;
}