tools: kmod: break iteration once a command is executed

This commit is contained in:
Caio Marcelo de Oliveira Filho 2015-01-14 12:02:16 -02:00 committed by Lucas De Marchi
parent 895aa13478
commit ace71985fc

View File

@ -124,10 +124,10 @@ static int handle_kmod_commands(int argc, char *argv[])
cmd = argv[optind];
for (i = 0, err = -EINVAL; i < ARRAY_SIZE(kmod_cmds); i++) {
if (strcmp(kmod_cmds[i]->name, cmd) != 0)
continue;
if (strcmp(kmod_cmds[i]->name, cmd) == 0) {
err = kmod_cmds[i]->cmd(--argc, ++argv);
break;
}
}
if (err < 0) {