Commit 60fd5c55 authored by GangCao's avatar GangCao Committed by Tomasz Zawadzki
Browse files

examples/bdevperf: check the successful status before dereferencing the pointer



Issue here is that the status could be negative due to NULL pointer and in the
callback, the status is not checked before dereferencing the pointer which is
NULL here.

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
parent 66657222
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -623,8 +623,11 @@ static void
bdevperf_channel_get_histogram_cb(void *cb_arg, int status, struct spdk_histogram_data *histogram)
{
	struct spdk_histogram_data *job_hist = cb_arg;

	if (status == 0) {
		spdk_histogram_data_merge(job_hist, histogram);
	}
}

static void
bdevperf_job_empty(struct bdevperf_job *job)