Due to the first switch() in that function, default case in second one is unreachable. Given that both of them contain the same cases but the first one merely acts as an invalid command barrier (adding no value to the second one), drop the first one to make invalid commands actually hit default case in the second switch(). Fixes: dd73ceecdbe87 ("nfct: Update syntax to specify command before subsystem") Signed-off-by: Phil Sutter <phil@xxxxxx> --- src/nfct-extensions/timeout.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/nfct-extensions/timeout.c b/src/nfct-extensions/timeout.c index 30f94642bd3bd..31e91a63de722 100644 --- a/src/nfct-extensions/timeout.c +++ b/src/nfct-extensions/timeout.c @@ -54,20 +54,6 @@ nfct_timeout_parse_params(struct mnl_socket *nl, int argc, char *argv[], int cmd return -1; } - switch (cmd) { - case NFCT_CMD_LIST: - case NFCT_CMD_ADD: - case NFCT_CMD_DELETE: - case NFCT_CMD_GET: - case NFCT_CMD_FLUSH: - case NFCT_CMD_DEFAULT_SET: - case NFCT_CMD_DEFAULT_GET: - break; - default: - nfct_cmd_timeout_usage(argv); - return -1; - } - switch (cmd) { case NFCT_CMD_LIST: ret = nfct_cmd_timeout_list(nl, argc, argv); -- 2.20.1