aboutsummaryrefslogtreecommitdiff
path: root/sbin/nvmecontrol
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2018-12-02 23:12:48 +0000
committerWarner Losh <imp@FreeBSD.org>2018-12-02 23:12:48 +0000
commitfbf14fe84b3e0ab6af921dc28f4d8455a77bbcbc (patch)
tree11f5bd6ec4e3ef8d2e7d8f2de8a9440876fc92c4 /sbin/nvmecontrol
parente2ed7941e048e931f1dc68ea516a99782d38125a (diff)
downloadsrc-fbf14fe84b3e0ab6af921dc28f4d8455a77bbcbc.tar.gz
src-fbf14fe84b3e0ab6af921dc28f4d8455a77bbcbc.zip
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
Notes
Notes: svn path=/head/; revision=341411
Diffstat (limited to 'sbin/nvmecontrol')
-rw-r--r--sbin/nvmecontrol/nvmecontrol.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/nvmecontrol/nvmecontrol.c b/sbin/nvmecontrol/nvmecontrol.c
index d67f8999995e..c4ac0f507f80 100644
--- a/sbin/nvmecontrol/nvmecontrol.c
+++ b/sbin/nvmecontrol/nvmecontrol.c
@@ -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++;
}