Skip to content
Commit 413a79cc authored by Samuel Holland's avatar Samuel Holland Committed by Greg Kroah-Hartman
Browse files

net: stmmac: dwmac-sun8i: Fix probe error handling



[ Upstream commit 7eeecc4b ]

stmmac_pltfr_remove does three things in one function, making it
inapproprate for unwinding the steps in the probe function. Currently,
a failure before the call to stmmac_dvr_probe would leak OF node
references due to missing a call to stmmac_remove_config_dt. And an
error in stmmac_dvr_probe would cause the driver to attempt to remove a
netdevice that was never added. Fix these by reordering the init and
splitting out the error handling steps.

Fixes: 9f93ac8d ("net-next: stmmac: Add dwmac-sun8i")
Fixes: 40a1dcee ("net: ethernet: dwmac-sun8i: Use the correct function in exit path")
Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
Reviewed-by: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8d12c062
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment