Skip to content

Commit a4bd852

Browse files
Dan CarpenterJames Bottomley
authored andcommitted
scsi_dh_alua: uninitialized variable in alua_rtpg()
It's possible to use "err" without initializing it. If it happens to be a 2 which is SCSI_DH_RETRY then that could cause a bug. Bart Van Assche pointed out that we should probably re-initialize it for every iteration through the retry loop. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Hannes Reinicke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <jejb@linux.vnet.ibm.com>
1 parent c3b46c7 commit a4bd852

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/scsi/device_handler/scsi_dh_alua.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
532532
return SCSI_DH_DEV_TEMP_BUSY;
533533

534534
retry:
535+
err = 0;
535536
retval = submit_rtpg(sdev, buff, bufflen, &sense_hdr, pg->flags);
536537

537538
if (retval) {

0 commit comments

Comments
 (0)