diff options
author | Gustavo A. R. Silva <garsilva@embeddedor.com> | 2017-10-17 20:59:20 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-19 14:27:54 +0200 |
commit | b14bec89042ee6f9a43b437f8133cfcbea140f20 (patch) | |
tree | a6f69db35b0afe87f9a32d1dcbf99a20f0482939 /drivers | |
parent | Merge branch 'ibmvnic-next' (diff) | |
download | linux-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.c | 3 |
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] && |