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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250312150835.00001851@huawei.com>
Date: Wed, 12 Mar 2025 15:08:35 +0000
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Thomas Gleixner <tglx@...utronix.de>
CC: LKML <linux-kernel@...r.kernel.org>, Marc Zyngier <maz@...nel.org>,
	Nishanth Menon <nm@...com>, Tero Kristo <kristo@...nel.org>, "Santosh
 Shilimkar" <ssantosh@...nel.org>, Jon Mason <jdmason@...zu.us>, Dave Jiang
	<dave.jiang@...el.com>, Allen Hubbe <allenbh@...il.com>,
	<ntb@...ts.linux.dev>, Bjorn Helgaas <bhelgaas@...gle.com>,
	<linux-pci@...r.kernel.org>, Haiyang Zhang <haiyangz@...rosoft.com>, Wei Liu
	<wei.liu@...nel.org>, <linux-hyperv@...r.kernel.org>, Wei Huang
	<wei.huang2@....com>, Manivannan Sadhasivam
	<manivannan.sadhasivam@...aro.org>, "James E.J. Bottomley"
	<James.Bottomley@...senPartnership.com>, "Martin K. Petersen"
	<martin.petersen@...cle.com>, <linux-scsi@...r.kernel.org>, Dan Williams
	<dan.j.williams@...el.com>
Subject: Re: [patch 02/10] genirq/msi: Use lock guards for MSI descriptor
 locking

On Tue, 11 Mar 2025 22:26:52 +0100
Thomas Gleixner <tglx@...utronix.de> wrote:

> On Tue, Mar 11 2025 at 18:00, Jonathan Cameron wrote:
> > On Sun,  9 Mar 2025 09:41:44 +0100 (CET)
> > Thomas Gleixner <tglx@...utronix.de> wrote:  
> 
> >>  
> >> @@ -1037,25 +1032,23 @@ bool msi_create_device_irq_domain(struct
> >>  	if (msi_setup_device_data(dev))  
> >
> > Hmm. We might want to make the docs in cleanup.h more nuanced.
> > They specifically say to not mix goto and auto cleanup, but 
> > in the case of scoped_guard() unlikely almost any other case
> > it should be fine.
> >  
> >>  		goto free_fwnode;  
> 
> I got rid of the gotos. It requires __free() for the two allocations.
That works.

> 
> Thanks,
> 
>         tglx
> ---
> --- a/include/linux/cleanup.h
> +++ b/include/linux/cleanup.h
> @@ -216,6 +216,8 @@ const volatile void * __must_check_fn(co
>  
>  #define return_ptr(p)	return no_free_ptr(p)
>  
> +#define retain_ptr(p)				\
> +	__get_and_null(p, NULL)
Single line?

This sort of thing got discussed in the past though I doubt I can find
the thread. There was some push back but maybe now is it's time!

Probably worth shouting about it a bit to attract attention. Maybe
a separate patch.

Jonathan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ