linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] software node: fixes for two smatch errors
@ 2019-08-29 13:21 Heikki Krogerus
  2019-08-29 13:21 ` [PATCH 1/2] software node: Fix use of potentially uninitialized variable Heikki Krogerus
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Heikki Krogerus @ 2019-08-29 13:21 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Greg Kroah-Hartman, linux-kernel

Hi,

Both potentially unitialized variable errors.

Heikki Krogerus (2):
  software node: Fix use of potentially uninitialized variable
  software node: Fix use of potentially uninitialized variable

 drivers/base/swnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.23.0.rc1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] software node: Fix use of potentially uninitialized variable
  2019-08-29 13:21 [PATCH 0/2] software node: fixes for two smatch errors Heikki Krogerus
@ 2019-08-29 13:21 ` Heikki Krogerus
  2019-08-29 13:21 ` [PATCH 2/2] " Heikki Krogerus
  2019-08-30  6:32 ` [PATCH 0/2] software node: fixes for two smatch errors Greg Kroah-Hartman
  2 siblings, 0 replies; 7+ messages in thread
From: Heikki Krogerus @ 2019-08-29 13:21 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'.

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>
---
 drivers/base/swnode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
index ee2a405cca9a..de9596fc4166 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -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 related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] software node: Fix use of potentially uninitialized variable
  2019-08-29 13:21 [PATCH 0/2] software node: fixes for two smatch errors Heikki Krogerus
  2019-08-29 13:21 ` [PATCH 1/2] software node: Fix use of potentially uninitialized variable Heikki Krogerus
@ 2019-08-29 13:21 ` Heikki Krogerus
  2019-08-29 13:28   ` Heikki Krogerus
  2019-08-29 13:50   ` Sasha Levin
  2019-08-30  6:32 ` [PATCH 0/2] software node: fixes for two smatch errors Greg Kroah-Hartman
  2 siblings, 2 replies; 7+ messages in thread
From: Heikki Krogerus @ 2019-08-29 13:21 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Greg Kroah-Hartman, linux-kernel, stable, kbuild test robot,
	Dan Carpenter

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

Fixes: 80488a6b1d3c ("software node: Add support for static node descriptors")
Cc: stable@vger.kernel.org
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>
---
 drivers/base/swnode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
index de9596fc4166..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)
-- 
2.23.0.rc1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] software node: Fix use of potentially uninitialized variable
  2019-08-29 13:21 ` [PATCH 2/2] " Heikki Krogerus
@ 2019-08-29 13:28   ` Heikki Krogerus
  2019-08-29 13:50   ` Sasha Levin
  1 sibling, 0 replies; 7+ messages in thread
From: Heikki Krogerus @ 2019-08-29 13:28 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Greg Kroah-Hartman, linux-kernel, stable, kbuild test robot,
	Dan Carpenter

On Thu, Aug 29, 2019 at 04:21:16PM +0300, Heikki Krogerus wrote:
> reported by smatch:
> drivers/base/swnode.c:71 software_node_to_swnode() error: uninitialized symbol 'swnode'.
> 
> Fixes: 80488a6b1d3c ("software node: Add support for static node descriptors")
> Cc: stable@vger.kernel.org

Sorry. That was not needed. I need to resend these.

I think I'll just squash these two patches together.

thanks,

-- 
heikki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] software node: Fix use of potentially uninitialized variable
  2019-08-29 13:21 ` [PATCH 2/2] " Heikki Krogerus
  2019-08-29 13:28   ` Heikki Krogerus
@ 2019-08-29 13:50   ` Sasha Levin
  1 sibling, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2019-08-29 13:50 UTC (permalink / raw)
  To: Heikki Krogerus
  Cc: Rafael J. Wysocki, Greg Kroah-Hartman, linux-kernel, stable,
	kbuild test robot, Dan Carpenter

On Thu, Aug 29, 2019 at 04:21:16PM +0300, Heikki Krogerus wrote:
>reported by smatch:
>drivers/base/swnode.c:71 software_node_to_swnode() error: uninitialized symbol 'swnode'.

Could you describe the actual problem it fixes? Under what scenario
would this issue occur and how would it manifest?

We're not here to fix smatch warnings, we're here to fix bugs that
smatch warns us about :)

--
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] software node: fixes for two smatch errors
  2019-08-29 13:21 [PATCH 0/2] software node: fixes for two smatch errors Heikki Krogerus
  2019-08-29 13:21 ` [PATCH 1/2] software node: Fix use of potentially uninitialized variable Heikki Krogerus
  2019-08-29 13:21 ` [PATCH 2/2] " Heikki Krogerus
@ 2019-08-30  6:32 ` Greg Kroah-Hartman
  2019-08-30  6:56   ` Heikki Krogerus
  2 siblings, 1 reply; 7+ messages in thread
From: Greg Kroah-Hartman @ 2019-08-30  6:32 UTC (permalink / raw)
  To: Heikki Krogerus; +Cc: Rafael J. Wysocki, linux-kernel

On Thu, Aug 29, 2019 at 04:21:14PM +0300, Heikki Krogerus wrote:
> Hi,
> 
> Both potentially unitialized variable errors.
> 
> Heikki Krogerus (2):
>   software node: Fix use of potentially uninitialized variable
>   software node: Fix use of potentially uninitialized variable

You can't send 2 different patches with identical subjects :(

Please make them unique as they should be doing different things.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] software node: fixes for two smatch errors
  2019-08-30  6:32 ` [PATCH 0/2] software node: fixes for two smatch errors Greg Kroah-Hartman
@ 2019-08-30  6:56   ` Heikki Krogerus
  0 siblings, 0 replies; 7+ messages in thread
From: Heikki Krogerus @ 2019-08-30  6:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Rafael J. Wysocki, linux-kernel

On Fri, Aug 30, 2019 at 08:32:24AM +0200, Greg Kroah-Hartman wrote:
> On Thu, Aug 29, 2019 at 04:21:14PM +0300, Heikki Krogerus wrote:
> > Hi,
> > 
> > Both potentially unitialized variable errors.
> > 
> > Heikki Krogerus (2):
> >   software node: Fix use of potentially uninitialized variable
> >   software node: Fix use of potentially uninitialized variable
> 
> You can't send 2 different patches with identical subjects :(
> 
> Please make them unique as they should be doing different things.

Yes. I prepared these without thinking. Sorry about that.

thanks,

-- 
heikki

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-30  6:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-29 13:21 [PATCH 0/2] software node: fixes for two smatch errors Heikki Krogerus
2019-08-29 13:21 ` [PATCH 1/2] software node: Fix use of potentially uninitialized variable Heikki Krogerus
2019-08-29 13:21 ` [PATCH 2/2] " Heikki Krogerus
2019-08-29 13:28   ` Heikki Krogerus
2019-08-29 13:50   ` Sasha Levin
2019-08-30  6:32 ` [PATCH 0/2] software node: fixes for two smatch errors Greg Kroah-Hartman
2019-08-30  6:56   ` Heikki Krogerus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).