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: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/402999
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Ziye Yang 2018-03-07 13:31:06 +08:00 committed by Jim Harris
parent b86c4b6541
commit 76c501834e

View File

@ -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;
}
}