software node: Get reference to parent swnode in get_parent op
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 3 Oct 2019 12:32:08 +0000 (15:32 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 26 Jan 2020 09:01:04 +0000 (10:01 +0100)
commit3da105401e6f7e7ba77fe412da4bdb5214274611
tree348931b183504f1be69b6e749bfa8390981eb733
parent3a77d9e20752b67cb3602cc5e4d9997f53e7d463
software node: Get reference to parent swnode in get_parent op

[ Upstream commit 51c100a651a471fcb8ead1ecc1224471eb0d61b9 ]

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: 59abd83672f7 ("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>
drivers/base/swnode.c