test: check for null before deref of g_head

Followup to earlier fix, didn't see this until after fixing bdev
the rest of the way...

Change-Id: Idc663ffe6a90e6cb3511e4e703f2e9c667a3eac4
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/419445
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Paul Luse 2018-07-16 17:03:12 -07:00 committed by Changpeng Liu
parent 8aaa707981
commit 4996d7b5c5

View File

@ -809,6 +809,9 @@ spdk_bdevperf_shutdown_cb(void)
/* Send events to stop all I/O on each core */
for (i = 0; i < spdk_env_get_core_count(); i++) {
if (g_head == NULL) {
break;
}
target = g_head[i];
if (target == NULL) {
break;