From: Hans de Goede <hdegoede@redhat.com>
To: "Markus Elfring" <Markus.Elfring@web.de>,
platform-driver-x86@vger.kernel.org,
kernel-janitors@vger.kernel.org,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] platform/x86/amd/pmf: Return directly after a failed apmf_if_call() in apmf_sbios_heartbeat_notify()
Date: Tue, 2 Jan 2024 13:37:50 +0100 [thread overview]
Message-ID: <1179c828-d0c2-4e04-9a79-767754bb3425@redhat.com> (raw)
In-Reply-To: <362ee824-fc53-4e19-9529-8b621657635b@web.de>
Hi,
On 12/28/23 09:42, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Thu, 28 Dec 2023 09:30:54 +0100
>
> The kfree() function was called in one case by
> the apmf_sbios_heartbeat_notify() function during error handling
> even if the passed variable contained a null pointer.
> This issue was detected by using the Coccinelle software.
>
> * Thus return directly after a call of the function “apmf_if_call” failed
> at the beginning.
>
> * Delete the label “out” which became unnecessary with this refactoring.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Thank you for your patch, I've applied this patch to my review-hans
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
> ---
> drivers/platform/x86/amd/pmf/acpi.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/amd/pmf/acpi.c b/drivers/platform/x86/amd/pmf/acpi.c
> index 4ec7957eb707..eb367e38c5ab 100644
> --- a/drivers/platform/x86/amd/pmf/acpi.c
> +++ b/drivers/platform/x86/amd/pmf/acpi.c
> @@ -135,11 +135,9 @@ static void apmf_sbios_heartbeat_notify(struct work_struct *work)
> dev_dbg(dev->dev, "Sending heartbeat to SBIOS\n");
> info = apmf_if_call(dev, APMF_FUNC_SBIOS_HEARTBEAT, NULL);
> if (!info)
> - goto out;
> + return;
>
> schedule_delayed_work(&dev->heart_beat, msecs_to_jiffies(dev->hb_interval * 1000));
> -
> -out:
> kfree(info);
> }
>
> --
> 2.43.0
>
>
prev parent reply other threads:[~2024-01-02 12:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-28 8:42 Markus Elfring
2024-01-02 12:37 ` Hans de Goede [this message]
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=1179c828-d0c2-4e04-9a79-767754bb3425@redhat.com \
--to=hdegoede@redhat.com \
--cc=Markus.Elfring@web.de \
--cc=Shyam-sundar.S-k@amd.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/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
all inboxes | Powered by JetHome®