diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-07-20 18:09:33 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-08-25 12:38:08 +0300 |
commit | b5ba5c36694d25e8267b767228a08df4e81760bd (patch) | |
tree | 03db80be5a1c8b73a02ef75f556a7f9bca667cfd /Documentation/devicetree | |
parent | 19cb691faf47bcd2ce16fececaf509ecb15a42c3 (diff) | |
download | linux-b5ba5c36694d25e8267b767228a08df4e81760bd.tar.xz |
i2c: imx: Make sure to unregister adapter on remove()
commit d98bdd3a5b50446d8e010be5b04ce81c4eabf728 upstream.
If for whatever reasons pm_runtime_resume_and_get() fails and .remove() is
exited early, the i2c adapter stays around and the irq still calls its
handler, while the driver data and the register mapping go away. So if
later the i2c adapter is accessed or the irq triggers this results in
havoc accessing freed memory and unmapped registers.
So unregister the software resources even if resume failed, and only skip
the hardware access in that case.
Fixes: 588eb93ea49f ("i2c: imx: add runtime pm support to improve the performance")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/devicetree')
0 files changed, 0 insertions, 0 deletions