Skip to contentSkip to conversation

software node: Fix use of potentially uninitialized variables

PATCH Superseded Heikki Krogerus 1 participant 1 message Aug 29, 2019

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Heikki Krogerus

author reviewer
#0 lore raw

PATCH v2 1/1 software node: Fix use of potentially uninitialized variables

reported by smatch:
drivers/base/swnode.c:656 software_node_find_by_name() error: uninitialized symbol 'swnode'. drivers/base/swnode.c:71 software_node_to_swnode() error: uninitialized symbol 'swnode'.

---
Hi,

I had separate patch for both errors in the first version.

thanks,

---
 drivers/base/swnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/base/swnode.c +2 -2
index ee2a405cca9a..a1f3f0994f9f 100644
@@ -51,7 +51,7 @@ EXPORT_SYMBOL_GPL(is_software_node);
 static struct swnode *
 software_node_to_swnode(const struct software_node *node)
 {
-	struct swnode *swnode;
+	struct swnode *swnode = NULL;
 	struct kobject *k;
 
 	if (!node)
@@ -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)
Signature · 1 line
2.23.0.rc1