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 <seth.howell@intel.com>
Change-Id: I09aa8e03c28f1a3448f68d6f4d9aa6e7003c4c1b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1983
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
Seth Howell 2020-04-22 16:36:58 -07:00 committed by Tomasz Zawadzki
parent bed1458044
commit fe089ae0cb

View File

@ -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");