summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/device_handler
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-04-14 20:20:34 +0200
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2016-04-30 18:24:50 +0200
commita4bd85203190990ad808abbd4a5dc848a950002c (patch)
tree15a0cec934f2f9913de30de68773d1611349a32f /drivers/scsi/device_handler
parentLinux 4.6-rc4 (diff)
downloadlinux-a4bd85203190990ad808abbd4a5dc848a950002c.tar.xz
linux-a4bd85203190990ad808abbd4a5dc848a950002c.zip
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>
Diffstat (limited to 'drivers/scsi/device_handler')
-rw-r--r--drivers/scsi/device_handler/scsi_dh_alua.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index 8eaed0522aa3..a655cf29c16f 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -532,6 +532,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
return SCSI_DH_DEV_TEMP_BUSY;
retry:
+ err = 0;
retval = submit_rtpg(sdev, buff, bufflen, &sense_hdr, pg->flags);
if (retval) {