Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76e0e70e authored by Felix Manlunas's avatar Felix Manlunas Committed by David S. Miller
Browse files

liquidio: do not dereference pointer if it's NULL

Fix smatch errors by not dereferencing iq pointer if it's NULL.

See http://marc.info/?l=kernel-janitors&m=148637299004834&w=2



Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarFelix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ca6d4480
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2447,7 +2447,7 @@ static int liquidio_napi_poll(struct napi_struct *napi, int budget)

	/* force enable interrupt if reg cnts are high to avoid wraparound */
	if ((work_done < budget && tx_done) ||
	    (iq->pkt_in_done >= MAX_REG_CNT) ||
	    (iq && iq->pkt_in_done >= MAX_REG_CNT) ||
	    (droq->pkt_count >= MAX_REG_CNT)) {
		tx_done = 1;
		napi_complete_done(napi, work_done);
+1 −1
Original line number Diff line number Diff line
@@ -1632,7 +1632,7 @@ static int liquidio_napi_poll(struct napi_struct *napi, int budget)

	/* force enable interrupt if reg cnts are high to avoid wraparound */
	if ((work_done < budget && tx_done) ||
	    (iq->pkt_in_done >= MAX_REG_CNT) ||
	    (iq && iq->pkt_in_done >= MAX_REG_CNT) ||
	    (droq->pkt_count >= MAX_REG_CNT)) {
		tx_done = 1;
		napi_complete_done(napi, work_done);