Skip to content

Commit

Permalink
fsl/fman: fix a leak in tgec_free()
Browse files Browse the repository at this point in the history
We set "tgec->cfg" to NULL before passing it to kfree().  There is no
need to set it to NULL at all.  Let's just delete it.

Fixes: 57ba4c9 ("fsl/fman: Add FMan MAC support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Nov 26, 2016
1 parent 8006f6b commit 1f1e70e
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/net/ethernet/freescale/fman/fman_tgec.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,6 @@ int tgec_free(struct fman_mac *tgec)
{
free_init_resources(tgec);

if (tgec->cfg)
tgec->cfg = NULL;

kfree(tgec->cfg);
kfree(tgec);

Expand Down

0 comments on commit 1f1e70e

Please sign in to comment.