summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/cavium
diff options
context:
space:
mode:
authorIntiyaz Basha <intiyaz.basha@cavium.com>2017-08-18 23:07:19 +0300
committerDavid S. Miller <davem@davemloft.net>2017-08-19 01:21:14 +0300
commitd2896116dbc7be7cabd5db414e008aef4a5e0a00 (patch)
tree063cd0f0874ab727b4c79d05d4cb1dfb6bc0dbcb /drivers/net/ethernet/cavium
parent9620fef27ed2cdb37bf6fd028f32bea2ef5119a8 (diff)
downloadlinux-d2896116dbc7be7cabd5db414e008aef4a5e0a00.tar.xz
liquidio: fix Smatch error
Fix Smatch error by not dereferencing iq pointer if it's NULL. See http://marc.info/?l=kernel-janitors&m=150296723301129&w=2 Also, remove unnecessary parentheses. Fixes: d314ac222829 ("liquidio: moved liquidio_napi_poll to lio_core.c") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Intiyaz Basha <intiyaz.basha@cavium.com> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium')
-rw-r--r--drivers/net/ethernet/cavium/liquidio/lio_core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c
index d4f0646084b7..0e7896cdb295 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_core.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c
@@ -668,8 +668,8 @@ static int liquidio_napi_poll(struct napi_struct *napi, int budget)
#define MAX_REG_CNT 2000000U
/* force enable interrupt if reg cnts are high to avoid wraparound */
- if (((work_done < budget) && (tx_done)) ||
- (iq->pkt_in_done >= MAX_REG_CNT) ||
+ if ((work_done < budget && tx_done) ||
+ (iq && iq->pkt_in_done >= MAX_REG_CNT) ||
(droq->pkt_count >= MAX_REG_CNT)) {
tx_done = 1;
napi_complete_done(napi, work_done);