Commit d7dd6ecc authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Jakub Kicinski

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: 34a5102c ("net: bgmac: allocate struct bgmac just once & don't copy it")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/a026153108dd21239036a032b95c25b5cece253b.1655153616.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 4b7a632a
...@@ -332,7 +332,6 @@ static void bgmac_remove(struct bcma_device *core) ...@@ -332,7 +332,6 @@ static void bgmac_remove(struct bcma_device *core)
bcma_mdio_mii_unregister(bgmac->mii_bus); bcma_mdio_mii_unregister(bgmac->mii_bus);
bgmac_enet_remove(bgmac); bgmac_enet_remove(bgmac);
bcma_set_drvdata(core, NULL); bcma_set_drvdata(core, NULL);
kfree(bgmac);
} }
static struct bcma_driver bgmac_bcma_driver = { static struct bcma_driver bgmac_bcma_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment