diff --git a/drivers/w1/w1_shell.c b/drivers/w1/w1_shell.c index aa0b06f2823..bd94c2a80b1 100644 --- a/drivers/w1/w1_shell.c +++ b/drivers/w1/w1_shell.c @@ -317,7 +317,7 @@ static int cmd_w1_configure(const struct shell *sh, size_t argc, char **argv) } } - if (type > W1_SETINGS_TYPE_COUNT) { + if (type >= W1_SETINGS_TYPE_COUNT) { shell_error(sh, "invalid type %u", type); return -EINVAL; }