linux-stable/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 i2c: algo: bit: use new macro to specifiy capabilities 2021-01-22 09:59:21 +01:00
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 i2c: add slave testunit driver 2020-09-21 11:02:17 +02:00
Makefile i2c: add slave testunit driver 2020-09-21 11:02:17 +02:00
i2c-boardinfo.c i2c: Remove support for dangling device properties 2021-04-10 21:43:02 +02:00
i2c-core-acpi.c i2c: ACPI: Replace acpi_bus_get_device() 2022-02-07 17:00:08 +01:00
i2c-core-base.c i2c: move core from strlcpy to strscpy 2022-08-11 23:02:52 +02:00
i2c-core-of.c i2c: use my kernel.org address from now on 2020-05-05 16:29:09 +02:00
i2c-core-slave.c i2c: add tracepoints for I2C slave events 2022-03-20 00:11:05 +01:00
i2c-core-smbus.c i2c: smbus: Check for parent device before dereference 2022-02-19 12:37:20 +01:00
i2c-core.h i2c: don't expose function which is only used internally 2022-02-15 09:58:57 +01:00
i2c-dev.c i2c: dev: Force case user pointers in compat_i2cdev_ioctl() 2022-04-15 23:30:59 +02:00
i2c-mux.c i2c: mux: add sysfs header 2019-06-22 07:32:33 +02:00
i2c-slave-eeprom.c i2c: busses: Use fallthrough pseudo-keyword 2020-07-23 22:04:08 +02:00
i2c-slave-testunit.c i2c: testunit: add support for block process calls 2021-02-12 11:11:04 +01:00
i2c-smbus.c i2c: move core from strlcpy to strscpy 2022-08-11 23:02:52 +02:00
i2c-stub.c i2c: stub: remove definition of DEBUG 2021-01-17 13:00:10 +01:00