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 <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
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 */