]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 13 Jan 2022 17:42:59 +0000 (18:42 +0100)
commita485ff85cf79e3d910b9a9d7f4b2a5209a29aa10
tree382071fc3afaad22354cd91541300d68f003c6b3
parenteed9d71b226c230364518cc32f71850e150bfad6
MIPS: generic/yamon-dt: fix uninitialized variable error

BugLink: https://bugs.launchpad.net/bugs/1954834
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/mips/generic/yamon-dt.c