summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGustavo A. R. Silva <garsilva@embeddedor.com>2017-10-17 20:59:20 +0200
committerDavid S. Miller <davem@davemloft.net>2017-10-19 14:27:54 +0200
commitb14bec89042ee6f9a43b437f8133cfcbea140f20 (patch)
treea6f69db35b0afe87f9a32d1dcbf99a20f0482939 /drivers
parentMerge branch 'ibmvnic-next' (diff)
downloadlinux-b14bec89042ee6f9a43b437f8133cfcbea140f20.tar.xz
linux-b14bec89042ee6f9a43b437f8133cfcbea140f20.zip
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>
Diffstat (limited to 'drivers')
-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)
do {
g = (struct octnic_gather *)
list_delete_head(&lio->glist[i]);
- if (g)
- kfree(g);
+ kfree(g);
} while (g);
if (lio->glists_virt_base && lio->glists_virt_base[i] &&