]> git.baikalelectronics.ru Git - 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)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Tue, 16 Nov 2021 08:27:01 +0000 (09:27 +0100)
commit7b8ae15896de6e38c7e4c010903cb8356f1b6c4b
treeb109083740a9d4eb2042faf42198b6b85cbddb6b
parentec8ac0bfb7c9f45026767e2e44e0e34b3eac397e
MIPS: generic/yamon-dt: fix uninitialized variable error

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: b5ae1cdb076f ("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>
arch/mips/generic/yamon-dt.c