lib: utils: missing initialization in thead_reset_init
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Tue, 8 Jun 2021 20:05:46 +0000 (22:05 +0200)
committerAnup Patel <anup@brainfault.org>
Fri, 11 Jun 2021 13:50:16 +0000 (19:20 +0530)
commit360ab88569201f8d282cf98546b86b8576b6f2ad
treeb9381c4b86e5928af6bd0863b3812182390a60ff
parent1da3d80b5bc074fce077adc47c97f3179c0addd9
lib: utils: missing initialization in thead_reset_init

If property csr-copy does not exist, fdt_getprop() will return NULL and cnt
will have a random value from the stack.

Call clone_csrs() only if cnt is initialized to a non-zero value.

Fixes: 49e422c5ad7a ("lib: utils: reset: Add T-HEAD sample platform reset driver")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
lib/utils/reset/fdt_reset_thead.c