Commit a502b88d authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

env_dpdk: allow spdk_mem_map_free() map to be NULL



There was already handling for a NULL map pointer pointer, but the inner
pointer wasn't checked.  Treat pointer to NULL as a no-op as well to
simplify calling code.

Change-Id: I0a213233c021957ab2f4b6c1dd304034ca98b868
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/367433


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarZiye Yang <optimistyzy@gmail.com>
Reviewed-by: default avatarPawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent ec7dad71
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -202,6 +202,10 @@ spdk_mem_map_free(struct spdk_mem_map **pmap)

	map = *pmap;

	if (!map) {
		return;
	}

	pthread_mutex_lock(&g_spdk_mem_map_mutex);
	spdk_mem_map_notify_walk(map, SPDK_MEM_MAP_NOTIFY_UNREGISTER);
	TAILQ_REMOVE(&g_spdk_mem_maps, map, tailq);