[PATCH] of: overlay: fix uninitialized read of variable

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

 



When there are no fragments, we return an uninitialized err.
Initialize err as zero, so it's returned in that case.

Signed-off-by: Ahmad Fatoum <ahmad@xxxxxx>
---
 drivers/of/overlay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index a35eddfa084e..b79dbff94dbf 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -162,7 +162,7 @@ int of_overlay_apply_tree(struct device_node *root,
 {
 	struct device_node *resolved;
 	struct device_node *fragment;
-	int err;
+	int err = 0;
 
 	resolved = of_resolve_phandles(root, overlay);
 	if (!resolved)
-- 
2.20.1


_______________________________________________
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