mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
software node: Get reference to parent swnode in get_parent op
[ Upstream commit51c100a651] 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. Fixes:59abd83672("drivers: base: Introducing software nodes to the firmware node framework") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3a77d9e207
commit
3da105401e
@@ -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 *
|
||||
|
||||
Reference in New Issue
Block a user