scsi_dh_alua: uninitialized variable in alua_check_vpd()
Subsystems (2)
PATCH 1/1 scsi_dh_alua: uninitialized variable in alua_check_vpd()
The pg_updated variable is support to be set to zero at the start but it is uninitialized.
drivers/scsi/device_handler/scsi_dh_alua.c +1 -1
@@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, {int rel_port =-1 , group_id;struct alua_port_group *pg, *old_pg =NULL ; -bool pg_updated; +bool pg_updated =0 ;unsigned long flags; group_id =scsi_vpd_tpg_id (sdev, &rel_port);
Quoted 12 lines · Dan Carpenter
The
pg_updatedvariable is support to be set to zero at the start but it is uninitialized.Fixes cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field')Signed-off-by Dan Carpenter <[email protected]>drivers/scsi/device_handler/scsi_dh_alua.c +0
-0
drivers/scsi/device_handler/scsi_dh_alua.c static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, · line 338
Quoted 8 lines
drivers/scsi/device_handler/scsi_dh_alua.c +1
-1@@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, {int rel_port =-1 , group_id;struct alua_port_group *pg, *old_pg =NULL ; -bool pg_updated; +bool pg_updated =0 ;unsigned long flags; group_id =scsi_vpd_tpg_id (sdev, &rel_port);
I'd prefer 'pg_updated = false'.
Not that we trip over a static code analyser here :-)
Cheers,
Hannes
Signature · 9 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) -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 1/1 scsi_dh_alua: uninitialized variable in alua_check_vpd()
The pg_updated variable is support to be set to false at the start but it is uninitialized.
drivers/scsi/device_handler/scsi_dh_alua.c +1 -1
@@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, {int rel_port =-1 , group_id;struct alua_port_group *pg, *old_pg =NULL ; -bool pg_updated; +bool pg_updated = false;unsigned long flags; group_id =scsi_vpd_tpg_id (sdev, &rel_port);
Quoted 11 lines · Dan Carpenter
The
pg_updatedvariable is support to be set to false at the start but it is uninitialized.Fixes cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field')Signed-off-by Dan Carpenter <[email protected]>drivers/scsi/device_handler/scsi_dh_alua.c +0
-0
drivers/scsi/device_handler/scsi_dh_alua.c static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, · line 338
Quoted 8 lines
drivers/scsi/device_handler/scsi_dh_alua.c +1
-1@@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, {int rel_port =-1 , group_id;struct alua_port_group *pg, *old_pg =NULL ; -bool pg_updated; +bool pg_updated = false;unsigned long flags; group_id =scsi_vpd_tpg_id (sdev, &rel_port);
Cheers,
Hannes
Signature · 9 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) -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 11 lines · Dan Carpenter
The
pg_updatedvariable is support to be set to false at the start but it is uninitialized.Fixes cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field')Signed-off-by Dan Carpenter <[email protected]>drivers/scsi/device_handler/scsi_dh_alua.c +0
-0
drivers/scsi/device_handler/scsi_dh_alua.c static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, · line 336
Quoted 6 lines
drivers/scsi/device_handler/scsi_dh_alua.c +1
-1@@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, {int rel_port =-1 , group_id;struct alua_port_group *pg, *old_pg =NULL ; -bool pg_updated; +bool pg_updated = false;unsigned long flags;
---
Manoj Kumar
Martin K. Petersen
AppliedQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Dan" = Dan Carpenter <[email protected]> writes:
Dan> The pg_updated variable is support to be set to false at the start Dan> but it is uninitialized.
Applied to 4.6/scsi-queue.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Quoted 19 lines · Hannes Reinecke
Quoted 18 lines · Dan Carpenter
The
pg_updatedvariable is support to be set to zero at the start but it is uninitialized.Fixes cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field')Signed-off-by Dan Carpenter <[email protected]>drivers/scsi/device_handler/scsi_dh_alua.c +1
-1@@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, {int rel_port =-1 , group_id;struct alua_port_group *pg, *old_pg =NULL ; -bool pg_updated; +bool pg_updated =0 ;unsigned long flags;
Quoted 4 lines
drivers/scsi/device_handler/scsi_dh_alua.c static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, · line 338
Quoted 2 lines
drivers/scsi/device_handler/scsi_dh_alua.c +0
-0group_id =scsi_vpd_tpg_id (sdev, &rel_port);I'd prefer '
pg_updated= false'.
Not that we trip over a static code analyser here :-)
Duh... Sorry about that.
regards,
dan carpenter