lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <43362d25-5be8-4158-bda2-2c8e9c4743f4@web.de>
Date: Mon, 4 Aug 2025 10:42:34 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Zhen Ni <zhen.ni@...ystack.cn>, linux-acpi@...r.kernel.org
Cc: stable@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
 Jassi Brar <jassisinghbrar@...il.com>, Sudeep Holla <sudeep.holla@....com>
Subject: Re: [PATCH v2] mailbox: pcc: Add missed acpi_put_table() to fix
 memory leak

> 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.

* You may occasionally put more than 66 characters into text lines
  of such a change description.
  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16#n658

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


…> ---
> Changes in v2:
> - Add tags of 'Fixes' and 'Cc'
> - Change goto target from out_put_pcct to e_nomem
…> +++ 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 e_nomem;
>  	}
…

Why do you not move the assignment statement accordingly?


…> @@ -796,17 +796,17 @@ static int pcc_mbox_probe(struct platform_device *pdev)
>  		    !pcc_mbox_ctrl->txdone_irq) {
>  			pr_err("Platform Interrupt flag must be set to 1");
>  			rc = -EINVAL;
> -			goto err;
> +			goto e_nomem;
>  		}
…

You misunderstood one of my development suggestions.


…> @@ -827,9 +827,8 @@ static int pcc_mbox_probe(struct platform_device *pdev)
…> -		return 0;
> -err:
> +
> +e_nomem:
>  	acpi_put_table(pcct_tbl);
>  	return rc;
>  }
Would an other code variant be more reasonable?

e_nomem:
	rc = -ENOMEM;
	goto err;


Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ