When the descriptor ring memzone cannot be reserved in
ixgbe_dev_tx_queue_setup(), the queue is released with
ixgbe_tx_queue_release().
That function does nothing while txq->ops is NULL, and
ops is only set after the memzone reservation, so the
queue structure is leaked.

Free the queue structure directly on that error path.

Fixes: 429c6d86b371 ("ixgbe: prepare for vector pmd")
Cc: [email protected]

Signed-off-by: Anurag Mandal <[email protected]>
---
 drivers/net/intel/ixgbe/ixgbe_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx.c 
b/drivers/net/intel/ixgbe/ixgbe_rxtx.c
index 49295b5dc8..32db2410b0 100644
--- a/drivers/net/intel/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/intel/ixgbe/ixgbe_rxtx.c
@@ -2855,7 +2855,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
                        sizeof(union ixgbe_adv_tx_desc) * IXGBE_MAX_RING_DESC,
                        IXGBE_ALIGN, socket_id);
        if (tz == NULL) {
-               ixgbe_tx_queue_release(txq);
+               rte_free(txq);
                return -ENOMEM;
        }
 
-- 
2.25.1

Reply via email to