ice_dcf_configure_queues() returns -EINVAL without
freeing the virtchnl message it allocated when the
required Rx descriptor ID (RXDID) is not supported,
so the message leaks on each failed port start.

Free it before return.

Fixes: 4b0d391f0eab ("net/ice: add queue config in DCF")
Fixes: f3fddc93de16 ("net/ice: fix build with 16-byte Rx descriptor in DCF")
Cc: [email protected]

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

diff --git a/drivers/net/intel/ice/ice_dcf.c b/drivers/net/intel/ice/ice_dcf.c
index d87655c11d..09fcf6454f 100644
--- a/drivers/net/intel/ice/ice_dcf.c
+++ b/drivers/net/intel/ice/ice_dcf.c
@@ -1232,6 +1232,7 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw)
                                    "Queue[%d]", vc_qp->rxq.rxdid, i);
                } else {
                        PMD_DRV_LOG(ERR, "RXDID 16 is not supported");
+                       rte_free(vc_config);
                        return -EINVAL;
                }
 #else
@@ -1244,6 +1245,7 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw)
                                        "Queue[%d]", vc_qp->rxq.rxdid, i);
                } else {
                        PMD_DRV_LOG(ERR, "RXDID == 0 is not supported");
+                       rte_free(vc_config);
                        return -EINVAL;
                }
 #endif
-- 
2.25.1

Reply via email to