From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: Davidlohr Bueso <dave@stgolabs.net>, rafael@kernel.org
Cc: daniel.lezcano@linaro.org, amitk@kernel.org, rui.zhang@intel.com,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] thermal: int340x: Fix bogus acpi_buffer pointer freeing
Date: Fri, 25 Mar 2022 05:25:57 -0700 [thread overview]
Message-ID: <41ac8f69c20b7c48c96dc1b26a7a25044a259e44.camel@linux.intel.com> (raw)
In-Reply-To: <20220324190950.70486-2-dave@stgolabs.net>
On Thu, 2022-03-24 at 12:09 -0700, Davidlohr Bueso wrote:
> It is the caller's responsibility to free only upon ACPI_SUCCESS.
>
Since context->ret.pointer will be NULL on failure so calling kfree
will just return.
Although we can avoid this call to kfree.
Thanks,
Srinivas
> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
> ---
> drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 4 ++--
> 1 file 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;
> }
>
next prev parent reply other threads:[~2022-03-25 12:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 19:09 [PATCH 0/3] thermal: int340x: Misc acpi_buffer handling updates Davidlohr Bueso
2022-03-24 19:09 ` [PATCH 1/3] thermal: int340x: Fix bogus acpi_buffer pointer freeing Davidlohr Bueso
2022-03-25 12:25 ` srinivas pandruvada [this message]
2022-04-05 18:27 ` Rafael J. Wysocki
2022-03-24 19:09 ` [PATCH 2/3] thermal: int340x: Consolidate freeing of acpi_buffer pointer Davidlohr Bueso
2022-03-24 19:09 ` [PATCH 3/3] thermal: int340x: Cleanup osc context init Davidlohr Bueso
2022-03-25 2:15 ` [PATCH 0/3] thermal: int340x: Misc acpi_buffer handling updates Zhang Rui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41ac8f69c20b7c48c96dc1b26a7a25044a259e44.camel@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=amitk@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=dave@stgolabs.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).