drivers/net: remove unnecessary null checks
The function rte_free() already handles NULL argument; therefore the checks in this code are unnecessary. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
parent
6ff065b221
commit
742d8aaa81
@ -81,12 +81,10 @@ gve_free_qpls(struct gve_priv *priv)
|
|||||||
for (i = 0; i < nb_txqs + nb_rxqs; i++) {
|
for (i = 0; i < nb_txqs + nb_rxqs; i++) {
|
||||||
if (priv->qpl[i].mz != NULL)
|
if (priv->qpl[i].mz != NULL)
|
||||||
rte_memzone_free(priv->qpl[i].mz);
|
rte_memzone_free(priv->qpl[i].mz);
|
||||||
if (priv->qpl[i].page_buses != NULL)
|
rte_free(priv->qpl[i].page_buses);
|
||||||
rte_free(priv->qpl[i].page_buses);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->qpl != NULL)
|
rte_free(priv->qpl);
|
||||||
rte_free(priv->qpl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -255,8 +255,7 @@ reset_single_rx_queue(struct idpf_rx_queue *rxq)
|
|||||||
rxq->rx_tail = 0;
|
rxq->rx_tail = 0;
|
||||||
rxq->nb_rx_hold = 0;
|
rxq->nb_rx_hold = 0;
|
||||||
|
|
||||||
if (rxq->pkt_first_seg != NULL)
|
rte_pktmbuf_free(rxq->pkt_first_seg);
|
||||||
rte_pktmbuf_free(rxq->pkt_first_seg);
|
|
||||||
|
|
||||||
rxq->pkt_first_seg = NULL;
|
rxq->pkt_first_seg = NULL;
|
||||||
rxq->pkt_last_seg = NULL;
|
rxq->pkt_last_seg = NULL;
|
||||||
|
@ -537,8 +537,7 @@ static void mlx5dr_onesize_element_db_uninit(struct mlx5dr_pool *pool)
|
|||||||
for (i = 0; i < MLX5DR_POOL_RESOURCE_ARR_SZ; i++) {
|
for (i = 0; i < MLX5DR_POOL_RESOURCE_ARR_SZ; i++) {
|
||||||
elem = pool->db.element_manager->elements[i];
|
elem = pool->db.element_manager->elements[i];
|
||||||
if (elem) {
|
if (elem) {
|
||||||
if (elem->bitmap)
|
rte_free(elem->bitmap);
|
||||||
rte_free(elem->bitmap);
|
|
||||||
simple_free(elem);
|
simple_free(elem);
|
||||||
pool->db.element_manager->elements[i] = NULL;
|
pool->db.element_manager->elements[i] = NULL;
|
||||||
}
|
}
|
||||||
|
@ -7039,10 +7039,8 @@ flow_hw_configure(struct rte_eth_dev *dev,
|
|||||||
if (dr_ctx)
|
if (dr_ctx)
|
||||||
claim_zero(mlx5dr_context_close(dr_ctx));
|
claim_zero(mlx5dr_context_close(dr_ctx));
|
||||||
for (i = 0; i < nb_q_updated; i++) {
|
for (i = 0; i < nb_q_updated; i++) {
|
||||||
if (priv->hw_q[i].indir_iq)
|
rte_ring_free(priv->hw_q[i].indir_iq);
|
||||||
rte_ring_free(priv->hw_q[i].indir_iq);
|
rte_ring_free(priv->hw_q[i].indir_cq);
|
||||||
if (priv->hw_q[i].indir_cq)
|
|
||||||
rte_ring_free(priv->hw_q[i].indir_cq);
|
|
||||||
}
|
}
|
||||||
mlx5_free(priv->hw_q);
|
mlx5_free(priv->hw_q);
|
||||||
priv->hw_q = NULL;
|
priv->hw_q = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user