Return after we find the dispatched function.

If the dispatched function doesn't exit, then we get can get a
spurious function not found message. They all do exit, but this is a
little cleaner.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403
This commit is contained in:
Warner Losh 2018-12-02 23:12:48 +00:00
parent e2ed7941e0
commit fbf14fe84b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=341411

View File

@ -73,8 +73,10 @@ dispatch_set(int argc, char *argv[], struct nvme_function **tbl,
}
while (f < tbl_limit) {
if (strcmp(argv[1], (*f)->name) == 0)
if (strcmp(argv[1], (*f)->name) == 0) {
(*f)->fn(argc-1, &argv[1]);
return;
}
f++;
}