[dpdk-dev,v3,26/27] net/ena: store handle after memory allocation

Message ID 20180607094322.14312-26-mk@semihalf.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/ena: new features and fixes |

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

Michal Krawczyk June 7, 2018, 9:43 a.m. UTC
  The pointer received from rte_memzone_reserve from macro
ENA_MEM_ALLOC_COHERENT_NODE was not stored anywhere, and as a result
memory allocated by this macro could not been released.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
---
 drivers/net/ena/base/ena_plat_dpdk.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h
index 8a04e84b9..900ba1a6b 100644
--- a/drivers/net/ena/base/ena_plat_dpdk.h
+++ b/drivers/net/ena/base/ena_plat_dpdk.h
@@ -237,6 +237,7 @@  extern uint32_t ena_alloc_cnt;
 				"ena_alloc_%d", ena_alloc_cnt++);	\
 		mz = rte_memzone_reserve(z_name, size, node,		\
 				RTE_MEMZONE_IOVA_CONTIG);		\
+		mem_handle = mz;					\
 		if (mz == NULL) {					\
 			virt = NULL;					\
 			phys = 0;					\
@@ -245,7 +246,6 @@  extern uint32_t ena_alloc_cnt;
 			virt = mz->addr;				\
 			phys = mz->iova;				\
 		}							\
-		(void)mem_handle;					\
 	} while (0)
 
 #define ENA_MEM_ALLOC_NODE(dmadev, size, virt, node, dev_node) \