summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@stgolabs.net>2022-03-24 20:09:48 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-04-05 20:25:21 +0200
commitbdff938d04409aba0e43e408ee47d45d1486b2ae (patch)
tree66838a39d4b32252b03e9ce1dd797d3101b95081
parentLinux 5.18-rc1 (diff)
downloadlinux-bdff938d04409aba0e43e408ee47d45d1486b2ae.tar.xz
linux-bdff938d04409aba0e43e408ee47d45d1486b2ae.zip
thermal: int340x: Clean up unnecessary acpi_buffer pointer freeing
It is the caller's responsibility to free only upon ACPI_SUCCESS. Signed-off-by: Davidlohr Bueso <dave@stgolabs.net> Acked-by: Zhang Rui <rui.zhang@intel.com> [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/thermal/intel/int340x_thermal/int3400_thermal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
index 4954800b9850..0e7931c286ec 100644
--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
@@ -186,11 +186,11 @@ static int int3400_thermal_run_osc(acpi_handle handle, char *uuid_str, int *enab
ret = *((u32 *)(context.ret.pointer + 4));
if (ret != *enable)
result = -EPERM;
+
+ kfree(context.ret.pointer);
} else
result = -EPERM;
- kfree(context.ret.pointer);
-
return result;
}