From 4d0833e6f8d4c9814b0c8fa1a2f8ed2263ae4856 Mon Sep 17 00:00:00 2001 From: Michal Jastrzebski Date: Fri, 29 Sep 2017 15:04:02 +0200 Subject: [PATCH] net/vmxnet3: fix dereference before null check Coverity reports check_after_deref: Null-checking rq suggests that it may be null, but it has already been dereferenced on all paths leading to the check. This patch removes NULL checking of "rq" from function vmxnet3_dev_rx_queue_reset as it is already checked against NULL one level up the callstack (function vmxnet3_dev_clear_queues). Coverity issue: 143468 Fixes: 5aecdc17a97d ("vmxnet3: fix stop/restart") Cc: stable@dpdk.org Signed-off-by: Tomasz Kulasek Signed-off-by: Michal Jastrzebski Reviewed-by: Ferruh Yigit --- drivers/net/vmxnet3/vmxnet3_rxtx.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index d08f5eb22c..c9a2df3f4d 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -265,11 +265,9 @@ vmxnet3_dev_rx_queue_reset(void *rxq) struct vmxnet3_rx_data_ring *data_ring = &rq->data_ring; int size; - if (rq != NULL) { - /* Release both the cmd_rings mbufs */ - for (i = 0; i < VMXNET3_RX_CMDRING_SIZE; i++) - vmxnet3_rx_cmd_ring_release_mbufs(&rq->cmd_ring[i]); - } + /* Release both the cmd_rings mbufs */ + for (i = 0; i < VMXNET3_RX_CMDRING_SIZE; i++) + vmxnet3_rx_cmd_ring_release_mbufs(&rq->cmd_ring[i]); ring0 = &rq->cmd_ring[0]; ring1 = &rq->cmd_ring[1]; -- 2.20.1