lkml.org 
[lkml]   [2019]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] software node: Fix use of potentially uninitialized variables
Date
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
\
 
 \ /
  Last update: 2019-08-29 15:33    [W:0.023 / U:2.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site