diff options
author | Hans de Goede <hdegoede@redhat.com> | 2021-10-31 16:25:22 +0100 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2021-11-02 13:47:19 +0100 |
commit | cdf10ffe8f626d8a2edc354abf063df0078b2d71 (patch) | |
tree | 235c1a94f992b9de6b8b2c815e0c48ab4c056cb3 /tools/perf/util/c++/clang.cpp | |
parent | 172d0ccea55ce69718bac693d2ea9341fb61b6c7 (diff) | |
download | linux-cdf10ffe8f626d8a2edc354abf063df0078b2d71.tar.gz linux-cdf10ffe8f626d8a2edc354abf063df0078b2d71.tar.bz2 linux-cdf10ffe8f626d8a2edc354abf063df0078b2d71.zip |
power: supply: bq27xxx: Fix kernel crash on IRQ handler register error
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: 703df6c09795 ("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>
Diffstat (limited to 'tools/perf/util/c++/clang.cpp')
0 files changed, 0 insertions, 0 deletions