summaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2020-04-07 20:49:41 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-04-14 11:15:43 +0200
commit2570742ccc2d5b7f2bbfef0733d1d1c093352d16 (patch)
treeceab613f63affca8056bf194777d8351959e3613 /drivers/of
parentdac73d73d13c2100c42dc40e6568d72a027133de (diff)
downloadbarebox-2570742ccc2d5b7f2bbfef0733d1d1c093352d16.tar.gz
barebox-2570742ccc2d5b7f2bbfef0733d1d1c093352d16.tar.xz
of: overlay: fix uninitialized read of variable
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@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/overlay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index a35eddfa08..b79dbff94d 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)