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: <20240516154823.00000974@Huawei.com>
Date: Thu, 16 May 2024 15:48:23 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Kousik Sanagavarapu <five231003@...il.com>
CC: Nathan Chancellor <nathan@...nel.org>, kernel test robot <lkp@...el.com>,
	Nishanth Menon <nm@...com>, Santosh Shilimkar <ssantosh@...nel.org>, Julia
 Lawall <julia.lawall@...ia.fr>, <llvm@...ts.linux.dev>,
	<oe-kbuild-all@...ts.linux.dev>, Shuah Khan <skhan@...uxfoundation.org>,
	Javier Carrasco <javier.carrasco.cruz@...il.com>,
	<linux-kernel@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 2/3] soc: ti: knav_qmss_queue: do device_node auto
 cleanup

On Mon, 13 May 2024 12:53:27 +0530
Kousik Sanagavarapu <five231003@...il.com> wrote:

> On Sun, May 12, 2024 at 11:44:51PM -0700, Nathan Chancellor wrote:
> > On Sun, May 12, 2024 at 03:56:22PM +0530, Kousik Sanagavarapu wrote:  
> > > On Sat, May 11, 2024 at 06:12:39PM +0800, kernel test robot wrote:  
> > > > Hi Kousik,
> > > > 
> > > > kernel test robot noticed the following build errors:
> > > >   
> > > 
> > > [...]
> > >   
> > > > All errors (new ones prefixed by >>):
> > > >   
> > > > >> drivers/soc/ti/knav_qmss_queue.c:1853:3: error: cannot jump from this goto statement to its label  
> > > >                    goto err;
> > > >                    ^
> > > >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> > > >            struct device_node *regions __free(device_node) =
> > > >                                ^  
> 
> [...]
> 
> > > Seems like gcc didn't catch this when I compiled locally.  
> > 
> > FWIW, you may notice this as you do more conversions. The fact that GCC
> > does not warn at all is a GCC bug as far as I am aware (i.e., clang's
> > error is correct):
> > 
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91951
> > 
> > which has come up in other places:
> > 
> > https://lore.kernel.org/20240425174732.GA270911@dev-arch.thelio-3990X/  
> 
> Thank you so much for these links :)
> 
> All my internet searches ended up at stackoverflow posts which didn't
> even describe the problem correctly, which also lead me to write an
> email explaining a partly erroneous solution, which is sitting in my
> mailbox ;)
> 
> Thanks again, these will help a lot.

Independent of all this, it's not a good idea form a readability point
of view to mix automated and manual cleanup.  So in cases like this
where you want to do scope based cleanup, use separate functions
that have appropriately defined scope (or brackets for the really minor
cases).

Here, you may just be able to push the device_node get into
knav_queue_setup_regions() for example.

Jonathan

> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ