Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1379192

[patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg()

From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject [patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg()
Date 2016-04-14 20:30 +0200
Message-ID <rnUbD-6hd-7@gated-at.bofh.it> (permalink)
References <rnUbD-6hd-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
v2: The first version just initialized it at the start of the function.

diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index 8eaed05..a655cf2 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) {

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg() Dan Carpenter <dan.carpenter@oracle.com> - 2016-04-14 20:30 +0200
  Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg() Hannes Reinecke <hare@suse.de> - 2016-04-15 08:00 +0200

csiph-web