examples/nvme/identify: assert optarg to satisfy analyser

Despite spdk_nvme_transport_id_parse() checking optarg for NULL, then
the Jenkins CI doing code-analysis fails with the error message:

"Null pointer passed as an argument to a 'nonnull' parameter"

This adds an assertion to satisfy the code-analysis.

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: I35f7ee659624c1d5a2abda91bccac9fb58393063
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6068
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
Simon A. F. Lund 2021-01-22 08:37:43 +01:00 committed by Tomasz Zawadzki
parent f79d4b8baf
commit 1b0134e0a9

View File

@ -1999,6 +1999,7 @@ parse_args(int argc, char **argv)
return 1;
}
assert(optarg != NULL);
hostnqn = strcasestr(optarg, "hostnqn:");
if (hostnqn) {
size_t len;