Commit 016049a8 authored by Heikki Krogerus's avatar Heikki Krogerus Committed by Rafael J. Wysocki
Browse files

software node: Initialize the return value in software_node_find_by_name()



The software node is searched from a list that may be empty
when the function is called. This makes sure that the
function returns NULL if the list is empty.

Fixes: 1666faed ("software node: Add software_node_find_by_name()")
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 61636873
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -633,7 +633,7 @@ static const struct fwnode_operations software_node_ops = {
const struct software_node *
software_node_find_by_name(const struct software_node *parent, const char *name)
{
	struct swnode *swnode;
	struct swnode *swnode = NULL;
	struct kobject *k;

	if (!name)