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>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <242118cf-4dee-4a94-8036-645d7fae2efb@web.de>
Date: Mon, 28 Apr 2025 18:35:43 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Zhe Qiao <qiaozhe@...as.ac.cn>, linux-acpi@...r.kernel.org,
 linux-pci@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
 Len Brown <lenb@...nel.org>, "Rafael J. Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH] ACPI: pci: Release excess memory usage

> In the pci_acpi_scan_root() function, if the PCI bus creation fails,

                                                                failed?


> the allocated memory should be released to avoid memory occupation.

Do you propose to complete the exception handling?

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.15-rc4#n145

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


…
> +++ b/drivers/pci/pci-acpi.c
…
> @@ -1710,6 +1708,11 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
>  		pcie_bus_configure_settings(child);
>  
>  	return bus;
> +
> +cleanup_exit:

How do you think about to use the label “free_root_ops”?


> +	kfree(root_ops);

I suggest to use another label “free_ri” so that a bit of duplicate exception handling code
can be avoided from a previous if branch.


> +	kfree(ri);
> +	return NULL;
>  }
…

How do you think about to benefit any more from the application of the attribute “__free”?
https://elixir.bootlin.com/linux/v6.15-rc4/source/include/linux/slab.h#L476

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ