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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jun 2022 12:22:01 +0000 (14:22 +0200)
commited66c8612bb48a79e44de40ae56c3650aa576d81
treea99c8a5997ecdb534109b91799e8aacd74c15787
parent32df93bd9d124c705b7bacd43c443cf4ae53c407
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>
drivers/net/ethernet/broadcom/bgmac-bcma.c