]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI / battery: Safe unregistering of hooks
authorJouke Witteveen <j.witteveen@gmail.com>
Wed, 4 Jul 2018 10:27:15 +0000 (12:27 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 4 Jul 2018 10:36:29 +0000 (12:36 +0200)
commitad4a2b256b4933f35beab870881ac4bdd61e4bd0
tree2ca1fcd964c3a1b8038840b4a009d5178ba36e9c
parent749c65c1b38017c420ee0efe4cf766101be057ac
ACPI / battery: Safe unregistering of hooks

A hooking API was implemented for 4.17 in 1b2cf89d2e99ad66 followed
by hooks for Thinkpad laptops in 33bd74ddc211f454. The Thinkpad
drivers did not support the Thinkpad 13 and the hooking API crashes
on unsupported batteries by altering a list of hooks during unsafe
iteration. Thus, Thinkpad 13 laptops could no longer boot.

Additionally, a lock was kept in place and debugging information was
printed out of order.

Fixes: 1b2cf89d2e99 (battery: Add the battery hooking API)
Cc: 4.17+ <stable@vger.kernel.org> # 4.17+
Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/battery.c