Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: bgmac: Fix an erroneous kfree() in bgmac_remove()

'bgmac' is part of a managed resource allocated with bgmac_alloc(). It
should not be freed explicitly.

Remove the erroneous kfree() from the .remove() function.

Fixes: 34a5102c3235 ("net: bgmac: allocate struct bgmac just once & don't copy it")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/a026153108dd21239036a032b95c25b5cece253b.1655153616.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Christophe JAILLET and committed by
Jakub Kicinski
d7dd6ecc 4b7a632a

-1
-1
drivers/net/ethernet/broadcom/bgmac-bcma.c
··· 332 332 bcma_mdio_mii_unregister(bgmac->mii_bus); 333 333 bgmac_enet_remove(bgmac); 334 334 bcma_set_drvdata(core, NULL); 335 - kfree(bgmac); 336 335 } 337 336 338 337 static struct bcma_driver bgmac_bcma_driver = {