mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] software node: Fix use of potentially uninitialized variables
@ 2019-08-29 13:32 Heikki Krogerus
  0 siblings, 0 replies; only message in thread
From: Heikki Krogerus @ 2019-08-29 13:32 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Greg Kroah-Hartman, linux-kernel, kbuild test robot, Dan Carpenter

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'.

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>
---
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(-)

diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
index ee2a405cca9a..a1f3f0994f9f 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -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)
-- 
2.23.0.rc1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-29 13:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-29 13:32 [PATCH v2] software node: Fix use of potentially uninitialized variables Heikki Krogerus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®