From 1b0134e0a94825d4fe06bc39b486b7b7ca11a5bf Mon Sep 17 00:00:00 2001 From: "Simon A. F. Lund" Date: Fri, 22 Jan 2021 08:37:43 +0100 Subject: [PATCH] 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 Change-Id: I35f7ee659624c1d5a2abda91bccac9fb58393063 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6068 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris Community-CI: Mellanox Build Bot --- examples/nvme/identify/identify.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/nvme/identify/identify.c b/examples/nvme/identify/identify.c index 647f4374b..7d8e4abd6 100644 --- a/examples/nvme/identify/identify.c +++ b/examples/nvme/identify/identify.c @@ -1999,6 +1999,7 @@ parse_args(int argc, char **argv) return 1; } + assert(optarg != NULL); hostnqn = strcasestr(optarg, "hostnqn:"); if (hostnqn) { size_t len;