Skip to content

Commit

Permalink
platform/x86: thinkpad_acpi: Fix a memory leak of EFCH MMIO resource
Browse files Browse the repository at this point in the history
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 <[email protected]>
Fixes: 455cd86 ("platform/x86: thinkpad_acpi: Add a s2idle resume quirk for a number of laptops")
Cc: Mario Limonciello <[email protected]>
Cc: Henrique de Moraes Holschuh <[email protected]>
Cc: Hans de Goede <[email protected]>
Cc: Mark Gross <[email protected]>
Reviewed-by: Mario Limonciello <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hans de Goede <[email protected]>
  • Loading branch information
jdelvare authored and jwrdegoede committed Jun 27, 2022
1 parent 79e90ca commit d2f33f0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit d2f33f0

Please sign in to comment.