]> git.baikalelectronics.ru Git - kernel.git/commit
acer-wmi: fix memory leaks in wmab_execute error path
authorAxel Lin <axel.lin@gmail.com>
Tue, 20 Jul 2010 22:19:53 +0000 (15:19 -0700)
committerMatthew Garrett <mjg@redhat.com>
Tue, 3 Aug 2010 13:49:04 +0000 (09:49 -0400)
commit9a79a0740b17633b6e8e5c4800cf9a539b5cf418
tree2086eff81fa49d9b9a5ab569a7b867f30c7d24d6
parentc3d607e4175bb13d9dfeb915c840567d065045c4
acer-wmi: fix memory leaks in wmab_execute error path

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

Call Trace:
wmab_execute
  -> wmi_evaluate_method
    -> acpi_evaluate_object

Thus if callers of wmab_execute() pass ACPI_ALLOCATE_BUFFER, the return
buffer must be kfreed if wmab_execute return AE_OK.

[akpm@linux-foundation.org: avoid multiple return points, remove unneeded cast, remove unneeded initialisation of `status']
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Thomas Renninger <trenn@suse.de>
Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
drivers/platform/x86/acer-wmi.c