[PATCH] blspec: fix return value of entry_is_of_compatible()

Ulrich Ölmann u.oelmann at pengutronix.de
Tue Sep 27 00:30:58 PDT 2016


The function returns a boolean and not an integer. Hence the former
explicit/implicit cast of an ERR_PTR to a boolean has led to a return value of
true although a bootspec entry with a faulty devicetree is not compatible.

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

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




More information about the barebox mailing list