summaryrefslogtreecommitdiff
path: root/drivers/cdx/controller/cdx_controller.c
diff options
context:
space:
mode:
authorArmin Wolf <W_Armin@gmx.de>2024-10-02 00:28:34 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-10-02 21:15:33 +0300
commit76959aff14a0012ad6b984ec7686d163deccdc16 (patch)
tree7a9753930916f3785beb50d884247970825f6c19 /drivers/cdx/controller/cdx_controller.c
parent86309cbed26139e1caae7629dcca1027d9a28e75 (diff)
downloadlinux-76959aff14a0012ad6b984ec7686d163deccdc16.tar.xz
ACPI: battery: Fix possible crash when unregistering a battery hook
When a battery hook returns an error when adding a new battery, then the battery hook is automatically unregistered. However the battery hook provider cannot know that, so it will later call battery_hook_unregister() on the already unregistered battery hook, resulting in a crash. Fix this by using the list head to mark already unregistered battery hooks as already being unregistered so that they can be ignored by battery_hook_unregister(). Fixes: fa93854f7a7e ("battery: Add the battery hooking API") Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://patch.msgid.link/20241001212835.341788-3-W_Armin@gmx.de Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cdx/controller/cdx_controller.c')
0 files changed, 0 insertions, 0 deletions