Commit 3021eb3c authored by GangCao's avatar GangCao Committed by Tomasz Zawadzki
Browse files

module/bdev: move the NULL check before dereference



To fix the Klocwork issue.

Change-Id: I9512f1303890b00964a902e28df2395856d3ed32
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10200


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarDong Yi <dongx.yi@intel.com>
parent 871e32ef
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -873,9 +873,9 @@ bdev_nvme_io_complete_nvme_status(struct nvme_bdev_io *bio,
	}

	nbdev_ch = spdk_io_channel_get_ctx(spdk_bdev_io_get_io_channel(bdev_io));
	nvme_ctrlr = nvme_ctrlr_channel_get_ctrlr(bio->io_path->ctrlr_ch);

	assert(bio->io_path != NULL);
	nvme_ctrlr = nvme_ctrlr_channel_get_ctrlr(bio->io_path->ctrlr_ch);

	if (spdk_nvme_cpl_is_path_error(cpl) ||
	    spdk_nvme_cpl_is_aborted_sq_deletion(cpl) ||