net/ena: store handle after memory allocation
authorMichal Krawczyk <mk@semihalf.com>
Thu, 7 Jun 2018 09:43:21 +0000 (11:43 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 14 Jun 2018 17:27:50 +0000 (19:27 +0200)
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

index 8a04e84..900ba1a 100644 (file)
@@ -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) \