]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI: custom_method: fix memory leaks
authorWenwen Wang <wenwen@cs.uga.edu>
Fri, 16 Aug 2019 05:08:27 +0000 (00:08 -0500)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 2 Sep 2019 21:17:22 +0000 (23:17 +0200)
commit2d9748602f1fd9cb23e59adc7ac78a9a30b4fc52
tree296fde035b930983a1e68cee556d6dfd30e16f4c
parent6656fd5a7b33aa6459652b24b0b1a9e597586c04
ACPI: custom_method: fix memory leaks

In cm_write(), 'buf' is allocated through kzalloc(). In the following
execution, if an error occurs, 'buf' is not deallocated, leading to memory
leaks. To fix this issue, free 'buf' before returning the error.

Fixes: e4125a4e421a ("ACPI: Split out custom_method functionality into an own driver")
Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/custom_method.c