Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] hpsa: fix uninitialized variable
@ 2016-11-22 15:05 Hannes Reinecke
  2016-11-22 16:32 ` Tomas Henzl
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Hannes Reinecke @ 2016-11-22 15:05 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, linux-scsi, Arnd Bergmann,
	Hannes Reinecke, Hannes Reinecke

With the recent patch to hpsa this warning is issued:

drivers/scsi/hpsa.c: In function 'hpsa_slave_alloc':
drivers/scsi/hpsa.c:2033:5: error: 'sd' may be used uninitialized in this function [-Werror=maybe-uninitialized]

The patch that caused this is marked for stable backports,
so this one has to be backported on top as well.

Fixes: 4eb307f7b18d ("scsi: hpsa: use bus '3' for legacy HBA devices")

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/hpsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 5834117..ac11201 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -2025,7 +2025,7 @@ static struct hpsa_scsi_dev_t *lookup_hpsa_scsi_dev(struct ctlr_info *h,
 
 static int hpsa_slave_alloc(struct scsi_device *sdev)
 {
-	struct hpsa_scsi_dev_t *sd;
+	struct hpsa_scsi_dev_t *sd = NULL;
 	unsigned long flags;
 	struct ctlr_info *h;
 
-- 
1.8.5.6


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

* Re: [PATCH] hpsa: fix uninitialized variable
  2016-11-22 15:05 [PATCH] hpsa: fix uninitialized variable Hannes Reinecke
@ 2016-11-22 16:32 ` Tomas Henzl
  2016-11-22 21:09 ` Arnd Bergmann
  2016-11-22 21:57 ` Martin K. Petersen
  2 siblings, 0 replies; 5+ messages in thread
From: Tomas Henzl @ 2016-11-22 16:32 UTC (permalink / raw)
  To: Hannes Reinecke, Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, linux-scsi, Arnd Bergmann,
	Hannes Reinecke

On 22.11.2016 16:05, Hannes Reinecke wrote:
> With the recent patch to hpsa this warning is issued:
>
> drivers/scsi/hpsa.c: In function 'hpsa_slave_alloc':
> drivers/scsi/hpsa.c:2033:5: error: 'sd' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
> The patch that caused this is marked for stable backports,
> so this one has to be backported on top as well.
>
> Fixes: 4eb307f7b18d ("scsi: hpsa: use bus '3' for legacy HBA devices")
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>

Looks good.

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

Tomas


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

* Re: [PATCH] hpsa: fix uninitialized variable
  2016-11-22 15:05 [PATCH] hpsa: fix uninitialized variable Hannes Reinecke
  2016-11-22 16:32 ` Tomas Henzl
@ 2016-11-22 21:09 ` Arnd Bergmann
  2016-11-22 21:57 ` Martin K. Petersen
  2 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2016-11-22 21:09 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley,
	linux-scsi, Hannes Reinecke

On Tuesday, November 22, 2016 4:05:38 PM CET Hannes Reinecke wrote:
> With the recent patch to hpsa this warning is issued:
> 
> drivers/scsi/hpsa.c: In function 'hpsa_slave_alloc':
> drivers/scsi/hpsa.c:2033:5: error: 'sd' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> 
> The patch that caused this is marked for stable backports,
> so this one has to be backported on top as well.
> 
> Fixes: 4eb307f7b18d ("scsi: hpsa: use bus '3' for legacy HBA devices")
> 
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> 

Reported-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>

Thanks!

	Arnd

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

* Re: [PATCH] hpsa: fix uninitialized variable
  2016-11-22 15:05 [PATCH] hpsa: fix uninitialized variable Hannes Reinecke
  2016-11-22 16:32 ` Tomas Henzl
  2016-11-22 21:09 ` Arnd Bergmann
@ 2016-11-22 21:57 ` Martin K. Petersen
  2016-11-23  7:20   ` Hannes Reinecke
  2 siblings, 1 reply; 5+ messages in thread
From: Martin K. Petersen @ 2016-11-22 21:57 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Martin K. Petersen, Christoph Hellwig, James Bottomley,
	linux-scsi, Arnd Bergmann, Hannes Reinecke

>>>>> "Hannes" == Hannes Reinecke <hare@suse.de> writes:

Hannes> With the recent patch to hpsa this warning is issued:
Hannes> drivers/scsi/hpsa.c: In function 'hpsa_slave_alloc':
Hannes> drivers/scsi/hpsa.c:2033:5: error: 'sd' may be used
Hannes> uninitialized in this function [-Werror=maybe-uninitialized]

I amended your original patch.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] hpsa: fix uninitialized variable
  2016-11-22 21:57 ` Martin K. Petersen
@ 2016-11-23  7:20   ` Hannes Reinecke
  0 siblings, 0 replies; 5+ messages in thread
From: Hannes Reinecke @ 2016-11-23  7:20 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, linux-scsi, Arnd Bergmann,
	Hannes Reinecke

On 11/22/2016 10:57 PM, Martin K. Petersen wrote:
>>>>>> "Hannes" == Hannes Reinecke <hare@suse.de> writes:
> 
> Hannes> With the recent patch to hpsa this warning is issued:
> Hannes> drivers/scsi/hpsa.c: In function 'hpsa_slave_alloc':
> Hannes> drivers/scsi/hpsa.c:2033:5: error: 'sd' may be used
> Hannes> uninitialized in this function [-Werror=maybe-uninitialized]
> 
> I amended your original patch.
> 
Ta.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

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

end of thread, other threads:[~2016-11-23  7:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-22 15:05 [PATCH] hpsa: fix uninitialized variable Hannes Reinecke
2016-11-22 16:32 ` Tomas Henzl
2016-11-22 21:09 ` Arnd Bergmann
2016-11-22 21:57 ` Martin K. Petersen
2016-11-23  7:20   ` Hannes Reinecke

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