Commit d5eb9855 authored by Marcin Spiewak's avatar Marcin Spiewak Committed by Tomasz Zawadzki
Browse files

lib/vhost: assert to check if bvdev is not NULL



Fixed issue detected by Coverity.
Added assert() to make sure bvdev returned from
to_blk_dev() function is not NULL.
This is common practice in the vhost_blk.c
file, but in one place the assert() was missing.

Change-Id: I47cbede9064cf6010c15d216b2f0879373ea2f1a
Signed-off-by: default avatarMarcin Spiewak <marcin.spiewak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23609


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Community-CI: Mellanox Build Bot
parent 16d862d0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1454,6 +1454,8 @@ session_start_poll_group(void *args)
	struct spdk_vhost_blk_dev *bvdev = to_blk_dev(pg->vdev);
	struct spdk_vhost_blk_session *bvsession = to_blk_session(pg->vsession);

	assert(bvdev != NULL);

	if (bvdev->bdev) {
		pg->io_channel = vhost_blk_get_io_channel(pg->vdev);
		SPDK_DEBUGLOG(vhost_blk, "%s: pg %p, pg io channel %p, thread %s, lcore %u\n",