From: Dan Carpenter Date: Thu, 24 Nov 2016 11:20:43 +0000 (+0300) Subject: fsl/fman: fix a leak in tgec_free() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1f1e70efe53c01844ce76d77c3383c2bcb6beb49;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git fsl/fman: fix a leak in tgec_free() 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c index efabb04a1ae8..4b0f3a50b293 100644 --- a/drivers/net/ethernet/freescale/fman/fman_tgec.c +++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c @@ -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);