mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] of: overlay: fix uninitialized read of variable
@ 2020-04-07 18:49 Ahmad Fatoum
  2020-04-14  9:15 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2020-04-07 18:49 UTC (permalink / raw)
  To: barebox

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] of: overlay: fix uninitialized read of variable
  2020-04-07 18:49 [PATCH] of: overlay: fix uninitialized read of variable Ahmad Fatoum
@ 2020-04-14  9:15 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2020-04-14  9:15 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Tue, Apr 07, 2020 at 08:49:41PM +0200, Ahmad Fatoum wrote:
> 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>
> ---
>  drivers/of/overlay.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
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:[~2020-04-14  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-07 18:49 [PATCH] of: overlay: fix uninitialized read of variable Ahmad Fatoum
2020-04-14  9:15 ` Sascha Hauer

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