From: Davidlohr Bueso Date: Thu, 24 Mar 2022 19:09:48 +0000 (-0700) Subject: thermal: int340x: Clean up unnecessary acpi_buffer pointer freeing X-Git-Tag: v5.19-rc1~181^2^2^2^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bdff938d04409aba0e43e408ee47d45d1486b2ae;p=thirdparty%2Flinux.git 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 Acked-by: Zhang Rui [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index 4954800b98502..0e7931c286ec9 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; }