ACPI / battery: Fix acpi_battery_exit on acpi_battery_init_async errors
authorHans de Goede <hdegoede@redhat.com>
Wed, 19 Apr 2017 12:02:09 +0000 (14:02 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 19 Apr 2017 20:53:35 +0000 (22:53 +0200)
commitbc39fbcf9c782970263bdc5b428e4a755db16efb
treee2af4c79990e6d1d3e80dee995598f196f00d5d4
parent8661423eea1a1b58417014716e3f1ba286072379
ACPI / battery: Fix acpi_battery_exit on acpi_battery_init_async errors

The acpi_lock_battery_dir() / acpi_bus_register_driver() calls in
acpi_battery_init_async() may fail.

Check that they succeeded before undoing them.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/battery.c