]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net: bgmac: Fix an erroneous kfree() in bgmac_remove()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 13 Jun 2022 20:53:50 +0000 (22:53 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 26 Aug 2022 08:53:29 +0000 (10:53 +0200)
BugLink: https://bugs.launchpad.net/bugs/1983149
[ Upstream commit d7dd6eccfbc95ac47a12396f84e7e1b361db654b ]

'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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/broadcom/bgmac-bcma.c

index 9513cfb5ba58c3d41a4198f2516223cf7c858062..0ce28bc955a4aec5cc7b1741f634f3420330783a 100644 (file)
@@ -323,7 +323,6 @@ static void bgmac_remove(struct bcma_device *core)
        bcma_mdio_mii_unregister(bgmac->mii_bus);
        bgmac_enet_remove(bgmac);
        bcma_set_drvdata(core, NULL);
-       kfree(bgmac);
 }
 
 static struct bcma_driver bgmac_bcma_driver = {