Skip to content
Commit f816b982 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Jakub Kicinski
Browse files

net: fec: Better handle pm_runtime_get() failing in .remove()



In the (unlikely) event that pm_runtime_get() (disguised as
pm_runtime_resume_and_get()) fails, the remove callback returned an
error early. The problem with this is that the driver core ignores the
error value and continues removing the device. This results in a
resource leak. Worse the devm allocated resources are freed and so if a
callback of the driver is called later the register mapping is already
gone which probably results in a crash.

Fixes: a31eda65 ("net: fec: fix clock count mis-match")
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20230510200020.1534610-1-u.kleine-koenig@pengutronix.de


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ef1148d4
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment