Check the return value of the i40e_xmit_cleanup function.

Coverity issue: 353617
Fixes: 4861cde46116 ("i40e: new poll mode driver")

Signed-off-by: Beilei Xing <beilei.x...@intel.com>
---
 drivers/net/i40e/i40e_rxtx.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index fd1ae80..f43fc0f 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -1038,8 +1038,9 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, 
uint16_t nb_pkts)
        txe = &sw_ring[tx_id];
 
        /* Check if the descriptor ring needs to be cleaned. */
-       if (txq->nb_tx_free < txq->tx_free_thresh)
-               i40e_xmit_cleanup(txq);
+       if ((txq->nb_tx_free < txq->tx_free_thresh) &&
+           (i40e_xmit_cleanup(txq) != 0))
+               return 0;
 
        for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) {
                td_cmd = 0;
-- 
2.7.4

Reply via email to