liquidio: fix Smatch error
Subsystems (3)
PATCH 1/1 liquidio: fix Smatch error
From: Intiyaz Basha <[email protected]>
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 <[email protected]>
Signed-off-by Intiyaz Basha <[email protected]>
Signed-off-by Felix Manlunas <[email protected]>
--- drivers/net/ethernet/cavium/liquidio/lio_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/cavium/liquidio/lio_core.c +2 -2
@@ -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);
Signature · 1 line
1.8.3.1
From: Felix Manlunas <[email protected]>
Date: Fri, 18 Aug 2017 13:07:19 -0700
Quoted 4 lines
From: Intiyaz Basha <[email protected]>
Fix Smatch error by not dereferencing iq pointer if it's NULL.
Quoted 8 lines
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 <[email protected]>Signed-off-by Intiyaz Basha <[email protected]>Signed-off-by Felix Manlunas <[email protected]>
Applied.