acer-wmi: fix memory leaks in WMID_set_capabilities and get_wmid_devices
authorAxel Lin <axel.lin@gmail.com>
Tue, 20 Jul 2010 22:19:52 +0000 (15:19 -0700)
committerMatthew Garrett <mjg@redhat.com>
Tue, 3 Aug 2010 13:49:03 +0000 (09:49 -0400)
commit669048639ca6d3fdfb2e75dd77b8f49434d57625
tree86a30799d2a76d1913b3ca9116bead864732cf49
parentf8ef3aecabe0e386303d028d02b6e5b23ac3a566
acer-wmi: fix memory leaks in WMID_set_capabilities and get_wmid_devices

When acpi_evaluate_object() is passed ACPI_ALLOCATE_BUFFER, the caller
must kfree the returned buffer if AE_OK is returned.

The callers of wmi_query_block() pass ACPI_ALLOCATE_BUFFER, and thus must
check its return value before accessing or kfree() on the buffer.

This patch adds a missing kfree(out.pointer) before exit
WMID_set_capabilities() and get_wmid_devices().

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
drivers/platform/x86/acer-wmi.c