net/qede: fix dereference before null check
Checks
Commit Message
From: Yunjian Wang <wangyunjian@huawei.com>
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 <wangyunjian@huawei.com>
---
drivers/net/qede/qede_rxtx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On 8/24/2020 12:46 PM, wangyunjian wrote:
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> 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 <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
On Mon, Aug 24, 2020 at 6:11 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 8/24/2020 12:46 PM, wangyunjian wrote:
> > From: Yunjian Wang <wangyunjian@huawei.com>
> >
> > 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 <wangyunjian@huawei.com>
>
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied to dpdk-next-net-mrvl/main. Thanks
>
@@ -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));