mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Kumaravel.Thiagarajan@microchip.com
Cc: Y_Ashley@163.com, arnd@arndb.de, dzm91@hust.edu.cn,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] misc: mchp_pci1xxxx: mchp_pci1xxxx_gp: add unwind goto
Date: Thu, 20 Apr 2023 14:04:46 +0200	[thread overview]
Message-ID: <ZEEqXqu2JoPlR8ig@kroah.com> (raw)
In-Reply-To: <BN8PR11MB3668BB25DB6028404F423086E9989@BN8PR11MB3668.namprd11.prod.outlook.com>

On Thu, Apr 13, 2023 at 04:43:10AM +0000, Kumaravel.Thiagarajan@microchip.com wrote:
> > -----Original Message-----
> > From: Xinyi Hou <Y_Ashley@163.com>
> > Sent: Sunday, April 9, 2023 6:18 PM
> > To: Kumaravel Thiagarajan - I21417
> > <Kumaravel.Thiagarajan@microchip.com>; Arnd Bergmann
> > <arnd@arndb.de>; Greg Kroah-Hartman <gregkh@linuxfoundation.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@163.com>
> > Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
> Reviewed-by: Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.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

      reply	other threads:[~2023-04-20 12:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-09 12:48 Xinyi Hou
2023-04-13  4:43 ` Kumaravel.Thiagarajan
2023-04-20 12:04   ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZEEqXqu2JoPlR8ig@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Kumaravel.Thiagarajan@microchip.com \
    --cc=Y_Ashley@163.com \
    --cc=arnd@arndb.de \
    --cc=dzm91@hust.edu.cn \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®