Skip to content

Commit

Permalink
net/ice: fix null function pointer call
Browse files Browse the repository at this point in the history
[ upstream commit a8880ad ]

In case rte_eth_dma_zone_reserve fails in ice_tx_queue_setup
ice_tx_queue_release is called on 0 allocated but not initialized
txq struct.
This may happen on ENOMEM condition, size exhaustion of
memconfig->memzones array as well as some others.

Fixes: edec6dd ("net/ice: remove redundant functions")

Signed-off-by: Tomasz Jonak <tomasz@graphiant.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
Tomasz Jonak authored and kevintraynor committed Nov 7, 2022
1 parent d95fd8e commit 82c8b37
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/ice/ice_rxtx.c
Expand Up @@ -1197,7 +1197,8 @@ ice_rx_queue_release(void *rxq)
return;
}

q->rx_rel_mbufs(q);
if (q->rx_rel_mbufs != NULL)
q->rx_rel_mbufs(q);
rte_free(q->sw_ring);
rte_memzone_free(q->mz);
rte_free(q);
Expand Down Expand Up @@ -1407,7 +1408,8 @@ ice_tx_queue_release(void *txq)
return;
}

q->tx_rel_mbufs(q);
if (q->tx_rel_mbufs != NULL)
q->tx_rel_mbufs(q);
rte_free(q->sw_ring);
rte_memzone_free(q->mz);
rte_free(q);
Expand Down

0 comments on commit 82c8b37

Please sign in to comment.