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

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@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


_______________________________________________
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-28  6:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-27  7:30 [PATCH] blspec: fix return value of entry_is_of_compatible() Ulrich Ölmann
2016-09-28  6:29 ` Sascha Hauer

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