[dpdk-dev] [PATCH] net/sfc: do not dereference pointer before check vs NULL

Andrew Rybchenko arybchenko at solarflare.com
Tue Apr 4 14:49:21 CEST 2017


Coverity issue: 1423925
Fixes: e18dbbd3083a ("net/sfc: remove EvQ info array to simplify reconfigure")

Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
Reviewed-by: Andy Moreton <amoreton at solarflare.com>
---
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



More information about the dev mailing list