From 76428561b343daafc163e4bf1d6b5e8f5454d63a Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 6 Jan 2019 12:26:28 +0100 Subject: [PATCH] cmd: ubi: remove unreachable code It does not make sense to check if argc < 2 a second time, especially after accessing argv[1]. Signed-off-by: Heinrich Schuchardt --- cmd/ubi.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/ubi.c b/cmd/ubi.c index a12ac703eb..c511a2fb76 100644 --- a/cmd/ubi.c +++ b/cmd/ubi.c @@ -472,12 +472,8 @@ static int do_ubi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (argc < 2) return CMD_RET_USAGE; - if (strcmp(argv[1], "detach") == 0) { - if (argc < 2) - return CMD_RET_USAGE; - + if (strcmp(argv[1], "detach") == 0) return ubi_detach(); - } if (strcmp(argv[1], "part") == 0) { const char *vid_header_offset = NULL; -- 2.39.5