Remove redundant NULL pointer checks before free functions found by nullfree.cocci
Signed-off-by: Stephen Hemminger <step...@networkplumber.org> --- drivers/compress/mlx5/mlx5_compress.c | 3 +-- drivers/compress/octeontx/otx_zip_pmd.c | 9 +++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index 82b871bd860a..b12951da8b51 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -146,8 +146,7 @@ mlx5_compress_qp_release(struct rte_compressdev *dev, uint16_t qp_id) void *opaq = qp->opaque_mr.addr; mlx5_common_verbs_dereg_mr(&qp->opaque_mr); - if (opaq != NULL) - rte_free(opaq); + rte_free(opaq); } mlx5_mr_btree_free(&qp->mr_ctrl.cache_bh); rte_free(qp); diff --git a/drivers/compress/octeontx/otx_zip_pmd.c b/drivers/compress/octeontx/otx_zip_pmd.c index dd62285b863e..26cdce60a859 100644 --- a/drivers/compress/octeontx/otx_zip_pmd.c +++ b/drivers/compress/octeontx/otx_zip_pmd.c @@ -337,8 +337,7 @@ zip_pmd_qp_release(struct rte_compressdev *dev, uint16_t qp_id) if (qp != NULL) { zipvf_q_term(qp); - if (qp->processed_pkts) - rte_ring_free(qp->processed_pkts); + rte_ring_free(qp->processed_pkts); rte_free(qp); dev->data->queue_pairs[qp_id] = NULL; @@ -423,10 +422,8 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, return 0; qp_setup_cleanup: - if (qp->processed_pkts) - rte_ring_free(qp->processed_pkts); - if (qp) - rte_free(qp); + rte_ring_free(qp->processed_pkts); + rte_free(qp); return -1; } -- 2.34.1