diff options
author | Jean Delvare <jdelvare@suse.de> | 2022-06-21 15:55:11 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2022-06-27 09:37:49 +0200 |
commit | f0da93cbaf7af868e34d611d555f4067b748ecdf (patch) | |
tree | 3cae701a67c159dda3878f0828022666b7823322 /drivers/platform/x86/thinkpad_acpi.c | |
parent | platform/x86/dell: Kconfig: Remove unnecessary "depends on X86_PLATFORM_DEVICES" (diff) | |
download | linux-f0da93cbaf7af868e34d611d555f4067b748ecdf.tar.xz linux-f0da93cbaf7af868e34d611d555f4067b748ecdf.zip |
platform/x86: thinkpad_acpi: Fix a memory leak of EFCH MMIO resource
Unlike release_mem_region(), a call to release_resource() does not
free the resource, so it has to be freed explicitly to avoid a memory
leak.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Fixes: 455cd867b85b ("platform/x86: thinkpad_acpi: Add a s2idle resume quirk for a number of laptops")
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Mark Gross <markgross@kernel.org>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20220621155511.5b266395@endymion.delvare
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/thinkpad_acpi.c')
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index c54c318bf9f6..17d503e65a54 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -4529,6 +4529,7 @@ static void thinkpad_acpi_amd_s2idle_restore(void) iounmap(addr); cleanup_resource: release_resource(res); + kfree(res); } static struct acpi_s2idle_dev_ops thinkpad_acpi_s2idle_dev_ops = { |