linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] scsi_dh_alua: uninitialized variable in alua_rtpg()
@ 2016-04-14  9:39 Dan Carpenter
  2016-04-14 15:45 ` Bart Van Assche
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2016-04-14  9:39 UTC (permalink / raw)
  To: James E.J. Bottomley
  Cc: Martin K. Petersen, Hannes Reinecke, Bart Van Assche,
	Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel,
	kernel-janitors

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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index 8eaed05..f3c994f 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -513,7 +513,8 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
 	struct alua_port_group *tmp_pg;
 	int len, k, off, valid_states = 0, bufflen = ALUA_RTPG_SIZE;
 	unsigned char *desc, *buff;
-	unsigned err, retval;
+	unsigned int err = 0;
+	unsigned int retval;
 	unsigned int tpg_desc_tbl_off;
 	unsigned char orig_transition_tmo;
 	unsigned long flags;

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-04-15 20:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-14  9:39 [patch] scsi_dh_alua: uninitialized variable in alua_rtpg() Dan Carpenter
2016-04-14 15:45 ` Bart Van Assche
2016-04-14 18:20   ` [patch v2] " Dan Carpenter
2016-04-14 18:55     ` Bart Van Assche
2016-04-15  5:59     ` Hannes Reinecke
2016-04-15 20:26     ` Martin K. Petersen
2016-04-14 18:20   ` [patch] " Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).