hpsa: fix uninitialized variable
Subsystems (2)
PATCH 1/1 hpsa: fix uninitialized variable
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.
--- drivers/scsi/hpsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/hpsa.c +1 -1
@@ -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;
Signature · 1 line
1.8.5.6
Quoted 11 lines · 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 <[email protected]>
Looks good.
Tomas
Quoted 5 lines · CET 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]
Quoted 7 lines
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 <[email protected]>
Thanks!
Arnd
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Hannes" == Hannes Reinecke <[email protected]> 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.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Quoted 9 lines · Martin K. Petersen
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Hannes" == Hannes Reinecke <[email protected]> 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
Signature · 5 lines
Dr. Hannes Reinecke Teamlead Storage & Networking [email protected] +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)