aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo A. R. Silva <garsilva@embeddedor.com>2017-10-17 14:59:20 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-19 08:27:54 -0400
commitb14bec89042ee6f9a43b437f8133cfcbea140f20 (patch)
treea6f69db35b0afe87f9a32d1dcbf99a20f0482939
parentac79a512b6fd5831a12859fd1d3c5e38103bcaeb (diff)
liquidio: remove unnecessary NULL check before kfree in delete_glists
NULL check before freeing functions like kfree is not needed. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Acked-by: Felix Manlunas <felix.manlunas@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/cavium/liquidio/lio_vf_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
index 2e993ce43b66..e4a112cf4f8e 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
@@ -435,8 +435,7 @@ static void delete_glists(struct lio *lio)
435 do { 435 do {
436 g = (struct octnic_gather *) 436 g = (struct octnic_gather *)
437 list_delete_head(&lio->glist[i]); 437 list_delete_head(&lio->glist[i]);
438 if (g) 438 kfree(g);
439 kfree(g);
440 } while (g); 439 } while (g);
441 440
442 if (lio->glists_virt_base && lio->glists_virt_base[i] && 441 if (lio->glists_virt_base && lio->glists_virt_base[i] &&