cmd: mtd: Prevent use of uninitialised variable
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Thu, 26 Jun 2025 10:49:32 +0000 (11:49 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 28 Oct 2025 18:10:47 +0000 (12:10 -0600)
commitce1bdedd2f4b3c5c8c76fbf2fc1a234fca470573
treeb2f55b3de65b2fe25197f8f53b7c27d706c9bf30
parentf12ca3e2b81beef901c182981bb70b0b2aec8f6c
cmd: mtd: Prevent use of uninitialised variable

ret maybe used uninitialised in some cases so instead
initialise it first to prevent this.

This issue was found by Smatch.

Fixes: 9671243e8d10 (cmd: mtd: Use the subcmd infrastructure to declare mtd sub-commands)
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
cmd/mtd.c