]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 16 Oct 2019 09:55:27 +0000 (11:55 +0200)
commitcb05ff348c5f60d0f94f10a03992f84fdfe7d243
tree1b008b1d5978d86720fda5b10cd03069fbd25547
parentfe271b8f72fd8f21a9871f503847de6194803308
ACPI: custom_method: fix memory leaks

BugLink: https://bugs.launchpad.net/bugs/1847155
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/acpi/custom_method.c