mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
net: stmmac: dwmac-qcom-ethqos: Drop an if with an always false condition
The remove callback is only ever called after .probe() returned successfully. After that get_stmmac_bsp_priv() always return non-NULL. Side note: The early exit would also be a bug because the return value of qcom_ethqos_remove() is ignored by the device core and the device is unbound unconditionally. So exiting early resulted in a dangerous resource leak as all devm allocated resources (some memory and the register mappings) are freed but the network device stays around. Using the network device afterwards probably oopses. Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Michal Kubiak <michal.kubiak@intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
b9bc44fe06
commit
c5f3ffe35c
1 changed files with 1 additions and 5 deletions
|
@ -667,11 +667,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
|
|||
|
||||
static int qcom_ethqos_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct qcom_ethqos *ethqos;
|
||||
|
||||
ethqos = get_stmmac_bsp_priv(&pdev->dev);
|
||||
if (!ethqos)
|
||||
return -ENODEV;
|
||||
struct qcom_ethqos *ethqos = get_stmmac_bsp_priv(&pdev->dev);
|
||||
|
||||
stmmac_pltfr_remove(pdev);
|
||||
ethqos_clks_config(ethqos, false);
|
||||
|
|
Loading…
Reference in a new issue