linux-stable/drivers/power
Hans de Goede 3f49a9d356 power: supply: bq27xxx: Fix kernel crash on IRQ handler register error
[ Upstream commit cdf10ffe8f ]

When registering the IRQ handler fails, do not just return the error code,
this will free the devm_kzalloc()-ed data struct while leaving the queued
work queued and the registered power_supply registered with both of them
now pointing to free-ed memory, resulting in various kernel crashes
soon afterwards.

Instead properly tear-down things on IRQ handler register errors.

Fixes: 703df6c097 ("power: bq27xxx_battery: Reorganize I2C into a module")
Cc: Andrew F. Davis <afd@ti.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-18 19:16:58 +01:00
..
reset power: reset: at91-reset: check properly the return value of devm_of_iomap 2021-11-18 19:16:49 +01:00
supply power: supply: bq27xxx: Fix kernel crash on IRQ handler register error 2021-11-18 19:16:58 +01:00
Kconfig PM: AVS: Drop the avs directory and the corresponding Kconfig 2020-10-22 18:39:32 +02:00
Makefile PM: AVS: Drop the avs directory and the corresponding Kconfig 2020-10-22 18:39:32 +02:00