]> Git Repo - linux.git/commitdiff
scsi_dh_alua: uninitialized variable in alua_rtpg()
authorDan Carpenter <[email protected]>
Thu, 14 Apr 2016 18:20:34 +0000 (21:20 +0300)
committerJames Bottomley <[email protected]>
Sat, 30 Apr 2016 16:24:50 +0000 (09:24 -0700)
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 <[email protected]>
Reviewed-by: Hannes Reinicke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
drivers/scsi/device_handler/scsi_dh_alua.c

index 8eaed0522aa36e83ddbe259a4fe2293c5ac61579..a655cf29c16f7d40367a859fb11f483e28252219 100644 (file)
@@ -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) {
This page took 0.060433 seconds and 4 git commands to generate.