projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
058f5e4
)
ACPI: thermal: Fix a small leak in acpi_thermal_add()
author
Dan Carpenter
<dan.carpenter@linaro.org>
Wed, 27 Sep 2023 12:37:26 +0000
(15:37 +0300)
committer
Rafael J. Wysocki
<rafael.j.wysocki@intel.com>
Wed, 27 Sep 2023 12:58:14 +0000
(14:58 +0200)
Free "tz" if the "trip" allocation fails.
Fixes: 5fc2189f9335 ("ACPI: thermal: Create and populate trip points table earlier")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/thermal.c
patch
|
blob
|
history
diff --git
a/drivers/acpi/thermal.c
b/drivers/acpi/thermal.c
index 10720a038846498bb4beb0465ed1e8e8d13031b4..f8a95939c88d50d52943dc7766faedca2a723974 100644
(file)
--- a/
drivers/acpi/thermal.c
+++ b/
drivers/acpi/thermal.c
@@
-928,8
+928,10
@@
static int acpi_thermal_add(struct acpi_device *device)
acpi_thermal_guess_offset(tz, crit_temp);
trip = kcalloc(trip_count, sizeof(*trip), GFP_KERNEL);
- if (!trip)
- return -ENOMEM;
+ if (!trip) {
+ result = -ENOMEM;
+ goto free_memory;
+ }
tz->trip_table = trip;