Commit 50f307e5 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

ublk: zero out poll_groups on failure



If ublk_open() fails (e.g. because the ublk_drv is not loaded),
poll_groups pointer was freed, but wasn't zeroed out, which would lead
to an assertion failure on subsequent ublk_create_target() calls.

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I1b61935aeb9cd19d91d0fda5b800fa137ed0af56
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19325


Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 87138323
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -571,6 +571,7 @@ ublk_create_target(const char *cpumask_str)
	if (rc != 0) {
		SPDK_ERRLOG("Fail to open UBLK, error=%s\n", spdk_strerror(-rc));
		free(g_ublk_tgt.poll_groups);
		g_ublk_tgt.poll_groups = NULL;
		return rc;
	}