diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2023-12-28 09:30:54 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2024-01-02 13:32:14 +0100 |
commit | 9dd3f1ef40d01fdfe69c3ada28b1f201a7207f6e (patch) | |
tree | abe19a62dea911fc5dcb3db9b774866725968b33 /drivers/platform/x86/amd | |
parent | platform/x86: wmi: linux/wmi.h: fix Excess kernel-doc description warning (diff) | |
download | linux-9dd3f1ef40d01fdfe69c3ada28b1f201a7207f6e.tar.xz linux-9dd3f1ef40d01fdfe69c3ada28b1f201a7207f6e.zip |
platform/x86/amd/pmf: Return directly after a failed apmf_if_call() in apmf_sbios_heartbeat_notify()
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>
Link: https://lore.kernel.org/r/362ee824-fc53-4e19-9529-8b621657635b@web.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/amd')
-rw-r--r-- | drivers/platform/x86/amd/pmf/acpi.c | 4 |
1 files changed, 1 insertions, 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); } |