Commit 76c50183 authored by Ziye Yang's avatar Ziye Yang Committed by Jim Harris
Browse files

lib/nvmf: set sgroup->channels[nsid] = NULL



We should add this state after free the io channel.
To make sure that we will not touch the wild pointer.

Change-Id: I570f649fe3ddffaea430125b40c6b6b020a05222
Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/402999


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent b86c4b65
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -474,6 +474,7 @@ poll_group_update_subsystem(struct spdk_nvmf_poll_group *group,
		for (i = new_num_channels; i < old_num_channels; i++) {
			if (sgroup->channels[i]) {
				spdk_put_io_channel(sgroup->channels[i]);
				sgroup->channels[i] = NULL;
			}
		}