Re: [PATCH] mailbox: pcc: Add missed acpi_put_table() to fix memory leak

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

 



> In pcc_mbox_probe(), the PCCT table acquired via acpi_get_table()
> is only released in error paths but not in the success path. This
> leads to a permanent ACPI memory leak when the driver successfully
> initializes.

How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16#n145


> The label name 'err' is no longer accurate because it handles both:
> 1. Error cases
> 2. Success case

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16#n94


…
> +++ b/drivers/mailbox/pcc.c
> @@ -763,19 +763,19 @@ static int pcc_mbox_probe(struct platform_device *pdev)
>  					 GFP_KERNEL);
>  	if (!pcc_mbox_channels) {
>  		rc = -ENOMEM;
> -		goto err;
> +		goto out_put_pcct;
>  	}
>  
>  	chan_info = devm_kcalloc(dev, count, sizeof(*chan_info), GFP_KERNEL);
>  	if (!chan_info) {
>  		rc = -ENOMEM;
> -		goto err;
> +		goto out_put_pcct;
>  	}
>  
>  	pcc_mbox_ctrl = devm_kzalloc(dev, sizeof(*pcc_mbox_ctrl), GFP_KERNEL);
>  	if (!pcc_mbox_ctrl) {
>  		rc = -ENOMEM;
> -		goto err;
> +		goto out_put_pcct;
>  	}
…

Can such exception handling be shared by using another jump target like “e_nomem”?

Regards,
Markus





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux