From fe089ae0cbd8c55a921ea1c02b256f2dc8073817 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Wed, 22 Apr 2020 16:36:58 -0700 Subject: [PATCH] lib/vhost: add an assert that lun is not NULL spdk_scsi_dev_get_lun will never return null when we ask for lun 0, but some static analysis tools complain. Signed-off-by: Seth Howell Change-Id: I09aa8e03c28f1a3448f68d6f4d9aa6e7003c4c1b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1983 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki Community-CI: Mellanox Build Bot --- lib/vhost/vhost_scsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vhost/vhost_scsi.c b/lib/vhost/vhost_scsi.c index cbd077298..a39efc9db 100644 --- a/lib/vhost/vhost_scsi.c +++ b/lib/vhost/vhost_scsi.c @@ -1517,6 +1517,7 @@ vhost_scsi_write_config_json(struct spdk_vhost_dev *vdev, struct spdk_json_write } lun = spdk_scsi_dev_get_lun(scsi_dev, 0); + assert(lun != NULL); spdk_json_write_object_begin(w); spdk_json_write_named_string(w, "method", "vhost_scsi_controller_add_target");