Mark Langsdorf 1cfd895643 ACPI: custom_method: fix a possible memory leak
In cm_write(), if the 'buf' is allocated memory but not fully consumed,
it is possible to reallocate the buffer without freeing it by passing
'*ppos' as 0 on a subsequent call.

Add an explicit kfree() before kzalloc() to prevent the possible memory
leak.

Fixes: 526b4af47f44 ("ACPI: Split out custom_method functionality into an own driver")
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
Cc: 5.4+ <stable@vger.kernel.org> # 5.4+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2021-04-28 19:17:54 +02:00
..
2021-04-26 17:04:41 +02:00
2020-11-10 18:52:51 +01:00
2021-03-19 17:45:49 +01:00
2021-03-19 17:45:49 +01:00
2021-04-08 16:17:32 +02:00
2019-06-23 09:23:33 +02:00
2021-04-26 17:04:41 +02:00
2021-04-26 17:04:41 +02:00
2021-01-22 16:17:19 +01:00
2021-02-20 21:50:59 -08:00
2021-04-26 17:04:41 +02:00
2021-04-26 17:04:41 +02:00
2020-11-09 19:08:06 +01:00
2020-11-09 19:25:20 +01:00
2021-02-25 18:57:40 +01:00
2021-02-25 18:57:40 +01:00
2019-11-13 11:12:08 +01:00
2021-02-10 19:09:43 +01:00
2021-04-26 17:04:41 +02:00
2021-04-26 17:04:41 +02:00
2021-03-19 17:45:49 +01:00
2020-11-09 19:08:06 +01:00
2020-11-09 19:08:06 +01:00
2021-04-26 17:04:41 +02:00
2020-07-09 14:09:28 +02:00
2020-11-09 19:08:06 +01:00