[PATCH] blspec: fix erroneus free in entry_is_of_compatible()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux