]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Oct 2019 10:30:25 +0000 (12:30 +0200)
commit5c12dadcbef8cd55ef1f5dac799bfcbb7ea7db1d
tree7026b004a9189e1319c78ccff6a468a264ca6a10
parenta927599941f9739e805b30eede41ddbf16fbf5ed
ACPI: custom_method: fix memory leaks

[ Upstream commit 03d1571d9513369c17e6848476763ebbd10ec2cb ]

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: 526b4af47f44 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/acpi/custom_method.c