Commit 04ce0e12 authored by yidong0635's avatar yidong0635 Committed by Jim Harris
Browse files

blob: fix scanbuild failures in this file.



Access to field 'tqh_first' results in a dereference of a null pointer
set = TAILQ_FIRST(&channel->reqs).
Add asserts to check if channel got NULL;

Change-Id: Ifd8d131a2432328d683e7fb9357fdd23b2396cf2
Signed-off-by: default avataryidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454536


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 1c8efbdd
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ spdk_bs_sequence_start(struct spdk_io_channel *_channel,
	struct spdk_bs_request_set	*set;

	channel = spdk_io_channel_get_ctx(_channel);

	assert(channel != NULL);
	set = TAILQ_FIRST(&channel->reqs);
	if (!set) {
		return NULL;
@@ -311,7 +311,7 @@ spdk_bs_batch_open(struct spdk_io_channel *_channel,
	struct spdk_bs_request_set	*set;

	channel = spdk_io_channel_get_ctx(_channel);

	assert(channel != NULL);
	set = TAILQ_FIRST(&channel->reqs);
	if (!set) {
		return NULL;
@@ -466,7 +466,7 @@ spdk_bs_user_op_alloc(struct spdk_io_channel *_channel, struct spdk_bs_cpl *cpl,
	struct spdk_bs_user_op_args	*args;

	channel = spdk_io_channel_get_ctx(_channel);

	assert(channel != NULL);
	set = TAILQ_FIRST(&channel->reqs);
	if (!set) {
		return NULL;