summaryrefslogtreecommitdiff
path: root/cmd/mtd.c
diff options
context:
space:
mode:
authorAndrew Goodbody <[email protected]>2025-06-26 11:49:32 +0100
committerTom Rini <[email protected]>2025-10-28 12:10:47 -0600
commitce1bdedd2f4b3c5c8c76fbf2fc1a234fca470573 (patch)
treeb2f55b3de65b2fe25197f8f53b7c27d706c9bf30 /cmd/mtd.c
parentf12ca3e2b81beef901c182981bb70b0b2aec8f6c (diff)
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 <[email protected]> Reviewed-by: Quentin Schulz <[email protected]>
Diffstat (limited to 'cmd/mtd.c')
-rw-r--r--cmd/mtd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/mtd.c b/cmd/mtd.c
index acd886da6da..d0072129659 100644
--- a/cmd/mtd.c
+++ b/cmd/mtd.c
@@ -477,7 +477,7 @@ static int do_mtd_io(struct cmd_tbl *cmdtp, int flag, int argc,
struct mtd_info *mtd;
u32 oob_len;
u8 *buf;
- int ret;
+ int ret = CMD_RET_SUCCESS;
if (argc < 2)
return CMD_RET_USAGE;