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: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/367433 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ziye Yang <optimistyzy@gmail.com> Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
ec7dad7199
commit
a502b88da6
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user