MIPS: generic/yamon-dt: fix uninitialized variable error
authorColin Ian King <colin.i.king@googlemail.com>
Wed, 10 Nov 2021 23:28:24 +0000 (23:28 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 09:39:15 +0000 (10:39 +0100)
commit34284b3a2f869473b7ae7268d37480b07428bb20
tree17c18594469025c41f24ce196a629149e3a8fe0b
parenta61f90b2162d0378db55f2234cb53c1af4bcb7f0
MIPS: generic/yamon-dt: fix uninitialized variable error

[ Upstream commit 255e51da15baed47531beefd02f222e4dc01f1c1 ]

In the case where fw_getenv returns an error when fetching values
for ememsizea and memsize then variable phys_memsize is not assigned
a variable and will be uninitialized on a zero check of phys_memsize.
Fix this by initializing phys_memsize to zero.

Cleans up cppcheck error:
arch/mips/generic/yamon-dt.c:100:7: error: Uninitialized variable: phys_memsize [uninitvar]

Fixes: f41d2430bbd6 ("MIPS: generic/yamon-dt: Support > 256MB of RAM")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/mips/generic/yamon-dt.c