software node: Initialize the return value in software_node_find_by_name()
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Fri, 30 Aug 2019 07:51:56 +0000 (10:51 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 11 Sep 2019 17:10:12 +0000 (19:10 +0200)
commit016049a816774edc9c3cd81afa7724d7ab001585
treea3de6b294e81063138c80328544bc60a03f7cccb
parent616368735e4aa6e3d25cd3474b746014ee490a7b
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: 1666faedb567 ("software node: Add software_node_find_by_name()")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/swnode.c