Commit 61636873 authored by Heikki Krogerus's avatar Heikki Krogerus Committed by Rafael J. Wysocki

software node: Initialize the return value in software_node_to_swnode()

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 even if the list is empty.

Fixes: 80488a6b ("software node: Add support for static node descriptors")
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 3a2650a8
...@@ -51,7 +51,7 @@ EXPORT_SYMBOL_GPL(is_software_node); ...@@ -51,7 +51,7 @@ EXPORT_SYMBOL_GPL(is_software_node);
static struct swnode * static struct swnode *
software_node_to_swnode(const struct software_node *node) software_node_to_swnode(const struct software_node *node)
{ {
struct swnode *swnode; struct swnode *swnode = NULL;
struct kobject *k; struct kobject *k;
if (!node) if (!node)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment