From: Somnath Kotur Date: Fri, 30 Oct 2020 07:03:03 +0000 (+0530) Subject: net/bnxt: add a failure log X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0bf5a0b5ebb8;p=dpdk.git net/bnxt: add a failure log Check and log an error message if switch domain free API fails Coverity issue: 362757 Fixes: 322bd6e70272 ("net/bnxt: add port representor infrastructure") Cc: stable@dpdk.org Signed-off-by: Somnath Kotur Reviewed-by: Kalesh AP --- diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index b199abb783..64a5278f96 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1346,8 +1346,14 @@ static int bnxt_dev_set_link_down_op(struct rte_eth_dev *eth_dev) static void bnxt_free_switch_domain(struct bnxt *bp) { - if (bp->switch_domain_id) - rte_eth_switch_domain_free(bp->switch_domain_id); + int rc = 0; + + if (bp->switch_domain_id) { + rc = rte_eth_switch_domain_free(bp->switch_domain_id); + if (rc) + PMD_DRV_LOG(ERR, "free switch domain:%d fail: %d\n", + bp->switch_domain_id, rc); + } } /* Unload the driver, release resources */