Commit a2dcdde2 authored by Ziye Yang's avatar Ziye Yang Committed by Changpeng Liu
Browse files

sock: Add the code to free the entry



Checked code, we do not free the memory allocated
spdk_sock_placement_id_entry.

Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
Change-Id: Ie614dc17334b21b8904b16ee7e6e68a24e29d6a3
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463725


Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 7751fe08
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ spdk_sock_map_release(int placement_id)
			entry->ref--;
			if (!entry->ref) {
				STAILQ_REMOVE(&g_placement_id_map, entry, spdk_sock_placement_id_entry, link);
				free(entry);
			}
			break;
		}
@@ -139,6 +140,7 @@ spdk_sock_remove_sock_group_from_map_table(struct spdk_sock_group *group)
	STAILQ_FOREACH_SAFE(entry, &g_placement_id_map, link, tmp) {
		if (entry->group == group) {
			STAILQ_REMOVE(&g_placement_id_map, entry, spdk_sock_placement_id_entry, link);
			free(entry);
		}
	}
	pthread_mutex_unlock(&g_map_table_mutex);