RE: [PATCH] platform/x86: thinkpad_acpi: Fix a memory leak of EFCH MMIO resource

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[Public]



> -----Original Message-----
> From: Jean Delvare <jdelvare@xxxxxxx>
> Sent: Tuesday, June 21, 2022 08:55
> To: ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx; platform-driver-
> x86@xxxxxxxxxxxxxxx
> Cc: Henrique de Moraes Holschuh <hmh@xxxxxxxxxx>; Hans de Goede
> <hdegoede@xxxxxxxxxx>; Mark Gross <markgross@xxxxxxxxxx>;
> Limonciello, Mario <Mario.Limonciello@xxxxxxx>
> Subject: [PATCH] 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.
> 

Thanks for finding and fixing this.

Reviewed-by: Mario Limonciello <mario.limonciello@xxxxxxx>

> Signed-off-by: Jean Delvare <jdelvare@xxxxxxx>
> Fixes: 455cd867b85b ("platform/x86: thinkpad_acpi: Add a s2idle resume
> quirk for a number of laptops")
> Cc: Mario Limonciello <mario.limonciello@xxxxxxx>
> Cc: Henrique de Moraes Holschuh <hmh@xxxxxxxxxx>
> Cc: Hans de Goede <hdegoede@xxxxxxxxxx>
> Cc: Mark Gross <markgross@xxxxxxxxxx>
> ---
>  drivers/platform/x86/thinkpad_acpi.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> --- linux-5.18.orig/drivers/platform/x86/thinkpad_acpi.c	2022-05-22
> 21:52:31.000000000 +0200
> +++ linux-5.18/drivers/platform/x86/thinkpad_acpi.c	2022-06-21
> 15:49:31.705166709 +0200
> @@ -4529,6 +4529,7 @@ static void thinkpad_acpi_amd_s2idle_res
>  	iounmap(addr);
>  cleanup_resource:
>  	release_resource(res);
> +	kfree(res);
>  }
> 
>  static struct acpi_s2idle_dev_ops thinkpad_acpi_s2idle_dev_ops = {
> 
> 
> --
> Jean Delvare
> SUSE L3 Support




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux