Skip to content

Commit

Permalink
liquidio: remove unnecessary NULL check before kfree in delete_glists
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gustavo A. R. Silva authored and David S. Miller committed Oct 19, 2017
1 parent ac79a51 commit b14bec8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] &&
Expand Down

0 comments on commit b14bec8

Please sign in to comment.