@ -26,7 +26,7 @@ int shell_buzzer(struct console *con, size_t argc, const char **argv)
fprintf(con->fp, "%u %d %u\n", buzzer_id, state, freq);
if (buzzer_id > nbuzzers) {
if (buzzer_id >= nbuzzers) {
fprintf(con->fp, "error: invalid buzzer ID %d\n", buzzer_id);
return -1;
}
@ -21,7 +21,7 @@ int shell_led(struct console *con, size_t argc, const char **argv)
if (argc >= 1)
led_id = strtoul(argv[0], NULL, 0);
if (led_id > nleds) {
if (led_id >= nleds) {
fprintf(con->fp, "error: unknown LED ID %d\n", led_id);