diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2022-06-13 22:53:50 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-22 14:13:17 +0200 |
commit | 28069e026e649683930f887b2d8f4a981b93bc41 (patch) | |
tree | 7eb28bccc0ab3d2b484435b74b177282c6005fef | |
parent | 984793f255732857861571de12e38dd8ba025f48 (diff) | |
download | linux-stable-28069e026e649683930f887b2d8f4a981b93bc41.tar.gz linux-stable-28069e026e649683930f887b2d8f4a981b93bc41.tar.bz2 linux-stable-28069e026e649683930f887b2d8f4a981b93bc41.zip |
net: bgmac: Fix an erroneous kfree() in bgmac_remove()
[ 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>
-rw-r--r-- | drivers/net/ethernet/broadcom/bgmac-bcma.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bgmac-bcma.c b/drivers/net/ethernet/broadcom/bgmac-bcma.c index a5fd161ab5ee..26746197515f 100644 --- a/drivers/net/ethernet/broadcom/bgmac-bcma.c +++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c @@ -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 = { |