ACPI / Battery: avoid acpi_battery_add() use-after-free
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Tue, 12 Jul 2011 08:03:28 +0000 (09:03 +0100)
committerLen Brown <len.brown@intel.com>
Sat, 16 Jul 2011 22:54:59 +0000 (18:54 -0400)
commite80bba4b5108c6479379740201b0a5d9da5ffbac
tree34634eebb8dc8f17e8654ffff0d5b6b2fb3a370b
parent9c921c22a7f33397a6774d7fa076db9b6a0fd669
ACPI / Battery: avoid acpi_battery_add() use-after-free

When acpi_battery_add_fs() fails the error handling code does not clean
up completely.  Moreover, it does not return resulting in a
use-after-free.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/battery.c