fsl/fman: fix a leak in tgec_free()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 24 Nov 2016 11:20:43 +0000 (14:20 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 26 Nov 2016 01:29:48 +0000 (20:29 -0500)
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: 57ba4c9b56d8 ("fsl/fman: Add FMan MAC support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fman/fman_tgec.c

index efabb04a1ae8cc445fab85eab8c8aede0dcd0a58..4b0f3a50b2939aa31fc6274235e263f1277461fb 100644 (file)
@@ -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);