Commit d09c3402 authored by Wei Yongjun's avatar Wei Yongjun Committed by sanglipeng
Browse files

net: bgmac: Drop free_netdev() from bgmac_enet_remove()

stable inclusion
from stable-v5.10.156
commit 6b23993d5bef1959926099b060c3e803e1caec6b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7MCG1

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6b23993d5bef1959926099b060c3e803e1caec6b



--------------------------------

[ Upstream commit 6f928ab8 ]

netdev is allocated in bgmac_alloc() with devm_alloc_etherdev() and will
be auto released in ->remove and ->probe failure path. Using free_netdev()
in bgmac_enet_remove() leads to double free.

Fixes: 34a5102c ("net: bgmac: allocate struct bgmac just once & don't copy it")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>

Link: https://lore.kernel.org/r/20221109150136.2991171-1-weiyongjun@huaweicloud.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent ef4a9b60
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment