No need for null check before calling rte_free. Found by devtools/cocci/nullfree.cocci
Signed-off-by: Stephen Hemminger <[email protected]> --- drivers/net/octeon_ep/cn20k_ep_mbox.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/octeon_ep/cn20k_ep_mbox.c b/drivers/net/octeon_ep/cn20k_ep_mbox.c index 8140ea07c7..3467dcae1e 100644 --- a/drivers/net/octeon_ep/cn20k_ep_mbox.c +++ b/drivers/net/octeon_ep/cn20k_ep_mbox.c @@ -415,8 +415,7 @@ otx_ep_cn20k_setup_mbox(struct otx_ep_device *otx_ep) return 0; free_mbox: - if (mbox_info->bbuf_base) - rte_free(mbox_info->bbuf_base); + rte_free(mbox_info->bbuf_base); rte_free(mbox_info); otx_ep->mbox_info = NULL; return ret; @@ -430,8 +429,7 @@ otx_ep_cn20k_delete_mbox(struct otx_ep_device *otx_ep) if (!mbox_info) return; - if (mbox_info->bbuf_base) - rte_free(mbox_info->bbuf_base); + rte_free(mbox_info->bbuf_base); rte_free(mbox_info); otx_ep->mbox_info = NULL; -- 2.53.0

