diff mbox series

spl: atf: Add missing ndepth initialization

Message ID 070166dca34245d8083caf6ae3597f45a81bef50.1576767114.git.michal.simek@xilinx.com
State Accepted
Commit 935568eecc4b3e9a493b6ba1517c1e066af63aef
Delegated to: Michal Simek
Headers show
Series spl: atf: Add missing ndepth initialization | expand

Commit Message

Michal Simek Dec. 19, 2019, 2:51 p.m. UTC
ndepth needs to be initialized before it is used in fdt_next_node().
Uninitialized value is causing that node is found and depth increase but
won't pass condition below because initial state wasn't setup.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 common/spl/spl_atf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michal Simek Jan. 16, 2020, 7:30 a.m. UTC | #1
čt 19. 12. 2019 v 15:52 odesílatel Michal Simek
<michal.simek@xilinx.com> napsal:
>
> ndepth needs to be initialized before it is used in fdt_next_node().
> Uninitialized value is causing that node is found and depth increase but
> won't pass condition below because initial state wasn't setup.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  common/spl/spl_atf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c
> index df2927420746..24fd35ed85f4 100644
> --- a/common/spl/spl_atf.c
> +++ b/common/spl/spl_atf.c
> @@ -112,7 +112,7 @@ static void bl31_entry(uintptr_t bl31_entry, uintptr_t bl32_entry,
>
>  static int spl_fit_images_find(void *blob, int os)
>  {
> -       int parent, node, ndepth;
> +       int parent, node, ndepth = 0;
>         const void *data;
>
>         if (!blob)
> --
> 2.24.0
>

Applied.
M
diff mbox series

Patch

diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c
index df2927420746..24fd35ed85f4 100644
--- a/common/spl/spl_atf.c
+++ b/common/spl/spl_atf.c
@@ -112,7 +112,7 @@  static void bl31_entry(uintptr_t bl31_entry, uintptr_t bl32_entry,
 
 static int spl_fit_images_find(void *blob, int os)
 {
-	int parent, node, ndepth;
+	int parent, node, ndepth = 0;
 	const void *data;
 
 	if (!blob)