From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Rybchenko Subject: [PATCH] net/sfc: do not dereference pointer before check vs NULL Date: Tue, 4 Apr 2017 13:49:21 +0100 Message-ID: <1491310161-24247-1-git-send-email-arybchenko@solarflare.com> Mime-Version: 1.0 Content-Type: text/plain To: Return-path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id CD99A2BF5 for ; Tue, 4 Apr 2017 14:49:29 +0200 (CEST) Received: from pure.maildistiller.com (unknown [10.110.50.29]) by dispatch1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTP id D77C88007E for ; Tue, 4 Apr 2017 12:49:28 +0000 (UTC) Received: from mx1-us4.ppe-hosted.com (unknown [10.110.49.251]) by pure.maildistiller.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 6ABE060053 for ; Tue, 4 Apr 2017 12:49:28 +0000 (UTC) Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1-us4.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 7285680064 for ; Tue, 4 Apr 2017 12:49:28 +0000 (UTC) Received: from uklogin.uk.solarflarecom.com (uklogin.uk.solarflarecom.com [10.17.10.10]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id v34CnOUS000407 for ; Tue, 4 Apr 2017 13:49:24 +0100 Received: from uklogin.uk.solarflarecom.com (localhost.localdomain [127.0.0.1]) by uklogin.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id v34CnOSw024281 for ; Tue, 4 Apr 2017 13:49:24 +0100 List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Coverity issue: 1423925 Fixes: e18dbbd3083a ("net/sfc: remove EvQ info array to simplify reconfigure") Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- It may be squashed into e18dbbd3083a. drivers/net/sfc/sfc_ev.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c index 26e6b2f..160d39f 100644 --- a/drivers/net/sfc/sfc_ev.c +++ b/drivers/net/sfc/sfc_ev.c @@ -673,11 +673,12 @@ sfc_ev_qstart(struct sfc_evq *evq, unsigned int hw_index) void sfc_ev_qstop(struct sfc_evq *evq) { - struct sfc_adapter *sa = evq->sa; + if (evq == NULL) + return; - sfc_log_init(sa, "hw_index=%u", evq->evq_index); + sfc_log_init(evq->sa, "hw_index=%u", evq->evq_index); - if (evq == NULL || evq->init_state != SFC_EVQ_STARTED) + if (evq->init_state != SFC_EVQ_STARTED) return; evq->init_state = SFC_EVQ_INITIALIZED; -- 2.7.4