Commit 35dfd3ea authored by yidong0635's avatar yidong0635 Committed by Tomasz Zawadzki
Browse files

memory: Fix memory leak of g_vtophys_map allocated failed.



if g_phys_ref_map allocated successfully and g_vtophys_map
allocated failed. It reports memory leaks. so add
spdk_mem_map_free(&g_phys_ref_map).

Signed-off-by: default avataryidong0635 <dongx.yi@intel.com>
Change-Id: I06149c98f158d1c679e5045e279beccbdea10e55
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7249


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarChengqiang Meng <chengqiangx.meng@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
parent f40b0b16
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1411,6 +1411,7 @@ vtophys_init(void)
	g_vtophys_map = spdk_mem_map_alloc(SPDK_VTOPHYS_ERROR, &vtophys_map_ops, NULL);
	if (g_vtophys_map == NULL) {
		DEBUG_PRINT("vtophys map allocation failed\n");
		spdk_mem_map_free(&g_phys_ref_map);
		return -ENOMEM;
	}
	return 0;