acrn-kernel/drivers/i2c
Uwe Kleine-König d98bdd3a5b i2c: imx: Make sure to unregister adapter on remove()
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: 588eb93ea4 ("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>
2022-08-21 10:27:33 +02:00
..
algos
busses i2c: imx: Make sure to unregister adapter on remove() 2022-08-21 10:27:33 +02:00
muxes i2c: mux-gpmux: Add of_node_put() when breaking out of loop 2022-07-26 23:10:59 +02:00
Kconfig
Makefile
i2c-boardinfo.c
i2c-core-acpi.c
i2c-core-base.c i2c: move core from strlcpy to strscpy 2022-08-11 23:02:52 +02:00
i2c-core-of.c
i2c-core-slave.c
i2c-core-smbus.c
i2c-core.h
i2c-dev.c
i2c-mux.c
i2c-slave-eeprom.c
i2c-slave-testunit.c
i2c-smbus.c i2c: move core from strlcpy to strscpy 2022-08-11 23:02:52 +02:00
i2c-stub.c