]> Git Repo - J-linux.git/commitdiff
software node: Initialize the return value in software_node_find_by_name()
authorHeikki Krogerus <[email protected]>
Fri, 30 Aug 2019 07:51:56 +0000 (10:51 +0300)
committerRafael J. Wysocki <[email protected]>
Wed, 11 Sep 2019 17:10:12 +0000 (19:10 +0200)
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 <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Heikki Krogerus <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/base/swnode.c

index 1838d72e618af0aac48f4da82d6f94ba8e31d1fa..a1f3f0994f9f9c9e3f3e7582ff37971f74a41984 100644 (file)
@@ -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)
This page took 0.049386 seconds and 4 git commands to generate.