[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZEEqXqu2JoPlR8ig@kroah.com>
Date: Thu, 20 Apr 2023 14:04:46 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Kumaravel.Thiagarajan@...rochip.com
Cc: Y_Ashley@....com, arnd@...db.de, dzm91@...t.edu.cn,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] misc: mchp_pci1xxxx: mchp_pci1xxxx_gp: add unwind goto
On Thu, Apr 13, 2023 at 04:43:10AM +0000, Kumaravel.Thiagarajan@...rochip.com wrote:
> > -----Original Message-----
> > From: Xinyi Hou <Y_Ashley@....com>
> > Sent: Sunday, April 9, 2023 6:18 PM
> > To: Kumaravel Thiagarajan - I21417
> > <Kumaravel.Thiagarajan@...rochip.com>; Arnd Bergmann
> > <arnd@...db.de>; Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> >
> > Smatch reported:
> >
> > drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c:73 gp_aux_bus_probe()
> > warn:
> > missing unwind goto?
> >
> > In gp_aux_bus_probe(), when the allocation of aux_bus-
> > >aux_device_wrapper[1] fails, it needs to clean up the allocated resources.
> >
> > Fix this by revising the return statement to a goto statement.
> >
> > Fixes: 393fc2f5948f ("misc: microchip: pci1xxxx: load auxiliary bus driver for
> > the PIO function in the multi-function endpoint of pci1xxxx device.")
> > Signed-off-by: Xinyi Hou <Y_Ashley@....com>
> > Reviewed-by: Dongliang Mu <dzm91@...t.edu.cn>
> Reviewed-by: Kumaravel Thiagarajan <kumaravel.thiagarajan@...rochip.com>
> > ---
> > The issue is found by static analysis, and the patch remains untest.
Despite all the reviewers, this patch is incorrect :(
Please test patches, or better yet, restructure the code to not need to
bail out in such a "deep" call path so that errors like this are not an
issue.
thanks,
greg k-h
Powered by blists - more mailing lists