[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190902101028.GZ2680@smile.fi.intel.com>
Date: Mon, 2 Sep 2019 13:10:28 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: Petr Mladek <pmladek@...e.com>, linux-kernel@...r.kernel.org,
rafael@...nel.org, linux-acpi@...r.kernel.org,
devicetree@...r.kernel.org, Rob Herring <robh@...nel.org>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Subject: Re: [PATCH v4 01/11] software node: Get reference to parent swnode
in get_parent op
On Mon, Sep 02, 2019 at 11:32:30AM +0300, Sakari Ailus wrote:
> The software_node_get_parent() returned a pointer to the parent swnode,
> but did not take a reference to it, leading the caller to put a reference
> that was not taken. Take that reference now.
>
Missed already given
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Fixes: 59abd83672f7 ("drivers: base: Introducing software nodes to the firmware node framework")
> Signed-off-by: Sakari Ailus <sakari.ailus@...ux.intel.com>
> Reviewed-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> ---
> drivers/base/swnode.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
> index e7b3aa3bd55ad..a7cb41812cfda 100644
> --- a/drivers/base/swnode.c
> +++ b/drivers/base/swnode.c
> @@ -520,7 +520,10 @@ software_node_get_parent(const struct fwnode_handle *fwnode)
> {
> struct swnode *swnode = to_swnode(fwnode);
>
> - return swnode ? (swnode->parent ? &swnode->parent->fwnode : NULL) : NULL;
> + if (!swnode || !swnode->parent)
> + return NULL;
> +
> + return fwnode_handle_get(&swnode->parent->fwnode);
> }
>
> static struct fwnode_handle *
> --
> 2.20.1
>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists