Ensure controller or namespace node name is specified before trying to

access it.

While here, also fix the identify usage message to show the -v and -x
parameters.

Sponsored by:	Intel
MFC after:	3 days
This commit is contained in:
Jim Harris 2013-07-09 21:33:12 +00:00
parent 9c0871b260
commit 08c29873bf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=253116
2 changed files with 5 additions and 1 deletions

View File

@ -259,6 +259,10 @@ identify(int argc, char *argv[])
while (getopt(argc, argv, "vx") != -1) ;
/* Check that a controller or namespace was specified. */
if (optind >= argc)
identify_usage();
target = argv[optind];
optreset = 1;

View File

@ -38,7 +38,7 @@
" nvmecontrol devlist\n"
#define IDENTIFY_USAGE \
" nvmecontrol identify <controller id|namespace id>\n"
" nvmecontrol identify [-x [-v]] <controller id|namespace id>\n"
#define PERFTEST_USAGE \
" nvmecontrol perftest <-n num_threads> <-o read|write>\n" \