Commit fe089ae0 authored by Seth Howell's avatar Seth Howell Committed by Tomasz Zawadzki
Browse files

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: default avatarSeth Howell <seth.howell@intel.com>
Change-Id: I09aa8e03c28f1a3448f68d6f4d9aa6e7003c4c1b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1983


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
parent bed14580
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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");