From: Yunjian Wang Date: Mon, 24 Aug 2020 11:46:53 +0000 (+0800) Subject: net/qede: fix dereference before null check X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b5c2f5a0ba7b2f7c21be167d5ea418c46552a299;p=dpdk.git net/qede: fix dereference before null check Coverity flags that 'fp->sb_info' variable is used before it's checked for NULL. This patch fixes this issue. Coverity issue: 260413 Fixes: 4c4bdadfa9e7 ("net/qede: refactoring multi-queue implementation") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang Reviewed-by: Ferruh Yigit --- diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index ea264f59d7..75d78cebb5 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -676,9 +676,9 @@ void qede_dealloc_fp_resc(struct rte_eth_dev *eth_dev) for (sb_idx = 0; sb_idx < QEDE_RXTX_MAX(qdev); sb_idx++) { fp = &qdev->fp_array[sb_idx]; - DP_INFO(edev, "Free sb_info index 0x%x\n", - fp->sb_info->igu_sb_id); if (fp->sb_info) { + DP_INFO(edev, "Free sb_info index 0x%x\n", + fp->sb_info->igu_sb_id); OSAL_DMA_FREE_COHERENT(edev, fp->sb_info->sb_virt, fp->sb_info->sb_phys, sizeof(struct status_block));