eventdev: fix memory leakage on thread creation failure
authorChengwen Feng <fengchengwen@huawei.com>
Fri, 30 Apr 2021 09:34:38 +0000 (17:34 +0800)
committerJerin Jacob <jerinj@marvell.com>
Mon, 3 May 2021 09:46:26 +0000 (11:46 +0200)
This patch fixes the issue that epoll_events memory is not released
after the intr thread created fail.

Fixes: 3810ae435783 ("eventdev: add interrupt driven queues to Rx adapter")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
lib/eventdev/rte_event_eth_rx_adapter.c

index d317e89..13dfb28 100644 (file)
@@ -1436,6 +1436,7 @@ rxa_create_intr_thread(struct rte_event_eth_rx_adapter *rx_adapter)
                return 0;
 
        RTE_EDEV_LOG_ERR("Failed to create interrupt thread err = %d\n", err);
+       rte_free(rx_adapter->epoll_events);
 error:
        rte_ring_free(rx_adapter->intr_ring);
        rx_adapter->intr_ring = NULL;