[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cce2a2ac-e0e7-45ec-9093-88e7acf78865@kadam.mountain>
Date: Tue, 18 Jul 2023 09:12:43 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Saravana Kannan <saravanak@...gle.com>
Cc: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] driver core: Fix an error handling path in
fw_devlink_create_devlink()
On Mon, Jul 17, 2023 at 11:57:51AM -0700, Saravana Kannan wrote:
> > ---
> > drivers/base/core.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/base/core.c b/drivers/base/core.c
> > index 3dff5037943e..854c1fab742c 100644
> > --- a/drivers/base/core.c
> > +++ b/drivers/base/core.c
> > @@ -2107,7 +2107,8 @@ static int fw_devlink_create_devlink(struct device *con,
> > fwnode_ancestor_init_without_drv(sup_handle)) {
> > dev_dbg(con, "Not linking %pfwf - might never become dev\n",
> > sup_handle);
> > - return -EINVAL;
> > + ret = -EINVAL;
> > + goto out;
> > }
> >
> > ret = -EAGAIN;
It would have been more obvious that put_device() is a no-op if this
ret = -EAGAIN were changed to "return -EAGAIN;". That would probably
silence some sort of static checker warning...
regards,
dan carpenter
Powered by blists - more mailing lists