* [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd()
@ 2016-03-11 10:17 ` Dan Carpenter
0 siblings, 0 replies; 33+ messages in thread
From: Dan Carpenter @ 2016-03-11 10:17 UTC (permalink / raw)
To: James E.J. Bottomley, Hannes Reinecke
Cc: Martin K. Petersen, Bart Van Assche, Johannes Thumshirn,
Ewan Milne, linux-scsi, linux-kernel, kernel-janitors
The pg_updated variable is support to be set to zero at the start but
it is uninitialized.
Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field')
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 5bcdf8d..e4f6174 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h,
{
int rel_port = -1, group_id;
struct alua_port_group *pg, *old_pg = NULL;
- bool pg_updated;
+ bool pg_updated = 0;
unsigned long flags;
group_id = scsi_vpd_tpg_id(sdev, &rel_port);
^ permalink raw reply related [flat|nested] 33+ messages in thread* [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd() @ 2016-03-11 10:17 ` Dan Carpenter 0 siblings, 0 replies; 33+ messages in thread From: Dan Carpenter @ 2016-03-11 10:17 UTC (permalink / raw) To: James E.J. Bottomley, Hannes Reinecke Cc: Martin K. Petersen, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors The pg_updated variable is support to be set to zero at the start but it is uninitialized. Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') 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 5bcdf8d..e4f6174 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, { int rel_port = -1, group_id; struct alua_port_group *pg, *old_pg = NULL; - bool pg_updated; + bool pg_updated = 0; unsigned long flags; group_id = scsi_vpd_tpg_id(sdev, &rel_port); ^ permalink raw reply related [flat|nested] 33+ messages in thread
* Re: [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd() 2016-03-11 10:17 ` Dan Carpenter (?) @ 2016-03-11 10:50 ` Hannes Reinecke -1 siblings, 0 replies; 33+ messages in thread From: Hannes Reinecke @ 2016-03-11 10:50 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 03/11/2016 11:17 AM, Dan Carpenter wrote: > The pg_updated variable is support to be set to zero at the start but > it is uninitialized. > > Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') > 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 5bcdf8d..e4f6174 100644 > --- a/drivers/scsi/device_handler/scsi_dh_alua.c > +++ b/drivers/scsi/device_handler/scsi_dh_alua.c > @@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, > { > int rel_port = -1, group_id; > struct alua_port_group *pg, *old_pg = NULL; > - bool pg_updated; > + bool pg_updated = 0; > unsigned long flags; > > group_id = scsi_vpd_tpg_id(sdev, &rel_port); > I'd prefer 'pg_updated = false'. Not that we trip over a static code analyser here :-) Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd() @ 2016-03-11 10:50 ` Hannes Reinecke 0 siblings, 0 replies; 33+ messages in thread From: Hannes Reinecke @ 2016-03-11 10:50 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 03/11/2016 11:17 AM, Dan Carpenter wrote: > The pg_updated variable is support to be set to zero at the start but > it is uninitialized. > > Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') > 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 5bcdf8d..e4f6174 100644 > --- a/drivers/scsi/device_handler/scsi_dh_alua.c > +++ b/drivers/scsi/device_handler/scsi_dh_alua.c > @@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, > { > int rel_port = -1, group_id; > struct alua_port_group *pg, *old_pg = NULL; > - bool pg_updated; > + bool pg_updated = 0; > unsigned long flags; > > group_id = scsi_vpd_tpg_id(sdev, &rel_port); > I'd prefer 'pg_updated = false'. Not that we trip over a static code analyser here :-) Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd() @ 2016-03-11 10:50 ` Hannes Reinecke 0 siblings, 0 replies; 33+ messages in thread From: Hannes Reinecke @ 2016-03-11 10:50 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 03/11/2016 11:17 AM, Dan Carpenter wrote: > The pg_updated variable is support to be set to zero at the start but > it is uninitialized. > > Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') > 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 5bcdf8d..e4f6174 100644 > --- a/drivers/scsi/device_handler/scsi_dh_alua.c > +++ b/drivers/scsi/device_handler/scsi_dh_alua.c > @@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, > { > int rel_port = -1, group_id; > struct alua_port_group *pg, *old_pg = NULL; > - bool pg_updated; > + bool pg_updated = 0; > unsigned long flags; > > group_id = scsi_vpd_tpg_id(sdev, &rel_port); > I'd prefer 'pg_updated = false'. Not that we trip over a static code analyser here :-) Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 33+ messages in thread
* [patch v2] scsi_dh_alua: uninitialized variable in alua_check_vpd() 2016-03-11 10:50 ` Hannes Reinecke @ 2016-03-11 11:19 ` Dan Carpenter -1 siblings, 0 replies; 33+ messages in thread From: Dan Carpenter @ 2016-03-11 11:19 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 The pg_updated variable is support to be set to false at the start but it is uninitialized. Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') 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 5bcdf8d..a404a41 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, { int rel_port = -1, group_id; struct alua_port_group *pg, *old_pg = NULL; - bool pg_updated; + bool pg_updated = false; unsigned long flags; group_id = scsi_vpd_tpg_id(sdev, &rel_port); ^ permalink raw reply related [flat|nested] 33+ messages in thread
* [patch v2] scsi_dh_alua: uninitialized variable in alua_check_vpd() @ 2016-03-11 11:19 ` Dan Carpenter 0 siblings, 0 replies; 33+ messages in thread From: Dan Carpenter @ 2016-03-11 11:19 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 The pg_updated variable is support to be set to false at the start but it is uninitialized. Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') 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 5bcdf8d..a404a41 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, { int rel_port = -1, group_id; struct alua_port_group *pg, *old_pg = NULL; - bool pg_updated; + bool pg_updated = false; unsigned long flags; group_id = scsi_vpd_tpg_id(sdev, &rel_port); ^ permalink raw reply related [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_check_vpd() 2016-03-11 11:19 ` Dan Carpenter (?) @ 2016-03-11 11:48 ` Hannes Reinecke -1 siblings, 0 replies; 33+ messages in thread From: Hannes Reinecke @ 2016-03-11 11:48 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 03/11/2016 12:19 PM, Dan Carpenter wrote: > The pg_updated variable is support to be set to false at the start but > it is uninitialized. > > Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') > 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 5bcdf8d..a404a41 100644 > --- a/drivers/scsi/device_handler/scsi_dh_alua.c > +++ b/drivers/scsi/device_handler/scsi_dh_alua.c > @@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, > { > int rel_port = -1, group_id; > struct alua_port_group *pg, *old_pg = NULL; > - bool pg_updated; > + bool pg_updated = false; > unsigned long flags; > > group_id = scsi_vpd_tpg_id(sdev, &rel_port); Reviewed-by: Hannes Reinecke <hare@suse.com> Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_check_vpd() @ 2016-03-11 11:48 ` Hannes Reinecke 0 siblings, 0 replies; 33+ messages in thread From: Hannes Reinecke @ 2016-03-11 11:48 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 03/11/2016 12:19 PM, Dan Carpenter wrote: > The pg_updated variable is support to be set to false at the start but > it is uninitialized. > > Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') > 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 5bcdf8d..a404a41 100644 > --- a/drivers/scsi/device_handler/scsi_dh_alua.c > +++ b/drivers/scsi/device_handler/scsi_dh_alua.c > @@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, > { > int rel_port = -1, group_id; > struct alua_port_group *pg, *old_pg = NULL; > - bool pg_updated; > + bool pg_updated = false; > unsigned long flags; > > group_id = scsi_vpd_tpg_id(sdev, &rel_port); Reviewed-by: Hannes Reinecke <hare@suse.com> Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_check_vpd() @ 2016-03-11 11:48 ` Hannes Reinecke 0 siblings, 0 replies; 33+ messages in thread From: Hannes Reinecke @ 2016-03-11 11:48 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 03/11/2016 12:19 PM, Dan Carpenter wrote: > The pg_updated variable is support to be set to false at the start but > it is uninitialized. > > Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') > 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 5bcdf8d..a404a41 100644 > --- a/drivers/scsi/device_handler/scsi_dh_alua.c > +++ b/drivers/scsi/device_handler/scsi_dh_alua.c > @@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, > { > int rel_port = -1, group_id; > struct alua_port_group *pg, *old_pg = NULL; > - bool pg_updated; > + bool pg_updated = false; > unsigned long flags; > > group_id = scsi_vpd_tpg_id(sdev, &rel_port); Reviewed-by: Hannes Reinecke <hare@suse.com> Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_check_vpd() 2016-03-11 11:19 ` Dan Carpenter @ 2016-03-11 14:40 ` Manoj Kumar -1 siblings, 0 replies; 33+ messages in thread From: Manoj Kumar @ 2016-03-11 14:40 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Hannes Reinecke, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 3/11/2016 5:19 AM, Dan Carpenter wrote: > The pg_updated variable is support to be set to false at the start but > it is uninitialized. > > Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') > 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 5bcdf8d..a404a41 100644 > --- a/drivers/scsi/device_handler/scsi_dh_alua.c > +++ b/drivers/scsi/device_handler/scsi_dh_alua.c > @@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, > { > int rel_port = -1, group_id; > struct alua_port_group *pg, *old_pg = NULL; > - bool pg_updated; > + bool pg_updated = false; > unsigned long flags; Reviewed-by: Manoj Kumar <manoj@linux.vnet.ibm.com> --- Manoj Kumar ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_check_vpd() @ 2016-03-11 14:40 ` Manoj Kumar 0 siblings, 0 replies; 33+ messages in thread From: Manoj Kumar @ 2016-03-11 14:40 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Hannes Reinecke, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 3/11/2016 5:19 AM, Dan Carpenter wrote: > The pg_updated variable is support to be set to false at the start but > it is uninitialized. > > Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') > 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 5bcdf8d..a404a41 100644 > --- a/drivers/scsi/device_handler/scsi_dh_alua.c > +++ b/drivers/scsi/device_handler/scsi_dh_alua.c > @@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, > { > int rel_port = -1, group_id; > struct alua_port_group *pg, *old_pg = NULL; > - bool pg_updated; > + bool pg_updated = false; > unsigned long flags; Reviewed-by: Manoj Kumar <manoj@linux.vnet.ibm.com> --- Manoj Kumar ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_check_vpd() 2016-03-11 11:19 ` Dan Carpenter @ 2016-03-14 20:02 ` Martin K. Petersen -1 siblings, 0 replies; 33+ messages in thread From: Martin K. Petersen @ 2016-03-14 20:02 UTC (permalink / raw) To: Dan Carpenter Cc: James E.J. Bottomley, Martin K. Petersen, Hannes Reinecke, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors >>>>> "Dan" = Dan Carpenter <dan.carpenter@oracle.com> writes: Dan> The pg_updated variable is support to be set to false at the start Dan> but it is uninitialized. Applied to 4.6/scsi-queue. -- Martin K. Petersen Oracle Linux Engineering ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_check_vpd() @ 2016-03-14 20:02 ` Martin K. Petersen 0 siblings, 0 replies; 33+ messages in thread From: Martin K. Petersen @ 2016-03-14 20:02 UTC (permalink / raw) To: Dan Carpenter Cc: James E.J. Bottomley, Martin K. Petersen, Hannes Reinecke, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors >>>>> "Dan" == Dan Carpenter <dan.carpenter@oracle.com> writes: Dan> The pg_updated variable is support to be set to false at the start Dan> but it is uninitialized. Applied to 4.6/scsi-queue. -- Martin K. Petersen Oracle Linux Engineering ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd() 2016-03-11 10:50 ` Hannes Reinecke @ 2016-03-11 11:19 ` Dan Carpenter -1 siblings, 0 replies; 33+ messages in thread From: Dan Carpenter @ 2016-03-11 11:19 UTC (permalink / raw) To: Hannes Reinecke Cc: James E.J. Bottomley, Martin K. Petersen, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On Fri, Mar 11, 2016 at 11:50:30AM +0100, Hannes Reinecke wrote: > On 03/11/2016 11:17 AM, Dan Carpenter wrote: > > The pg_updated variable is support to be set to zero at the start but > > it is uninitialized. > > > > Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') > > 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 5bcdf8d..e4f6174 100644 > > --- a/drivers/scsi/device_handler/scsi_dh_alua.c > > +++ b/drivers/scsi/device_handler/scsi_dh_alua.c > > @@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, > > { > > int rel_port = -1, group_id; > > struct alua_port_group *pg, *old_pg = NULL; > > - bool pg_updated; > > + bool pg_updated = 0; > > unsigned long flags; > > > > group_id = scsi_vpd_tpg_id(sdev, &rel_port); > > > I'd prefer 'pg_updated = false'. > Not that we trip over a static code analyser here :-) Duh... Sorry about that. regards, dan carpenter ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd() @ 2016-03-11 11:19 ` Dan Carpenter 0 siblings, 0 replies; 33+ messages in thread From: Dan Carpenter @ 2016-03-11 11:19 UTC (permalink / raw) To: Hannes Reinecke Cc: James E.J. Bottomley, Martin K. Petersen, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On Fri, Mar 11, 2016 at 11:50:30AM +0100, Hannes Reinecke wrote: > On 03/11/2016 11:17 AM, Dan Carpenter wrote: > > The pg_updated variable is support to be set to zero at the start but > > it is uninitialized. > > > > Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') > > 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 5bcdf8d..e4f6174 100644 > > --- a/drivers/scsi/device_handler/scsi_dh_alua.c > > +++ b/drivers/scsi/device_handler/scsi_dh_alua.c > > @@ -332,7 +332,7 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h, > > { > > int rel_port = -1, group_id; > > struct alua_port_group *pg, *old_pg = NULL; > > - bool pg_updated; > > + bool pg_updated = 0; > > unsigned long flags; > > > > group_id = scsi_vpd_tpg_id(sdev, &rel_port); > > > I'd prefer 'pg_updated = false'. > Not that we trip over a static code analyser here :-) Duh... Sorry about that. regards, dan carpenter ^ permalink raw reply [flat|nested] 33+ messages in thread
* [patch] scsi_dh_alua: uninitialized variable in alua_rtpg() @ 2016-04-14 9:39 ` Dan Carpenter 0 siblings, 0 replies; 33+ 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] 33+ messages in thread
* [patch] scsi_dh_alua: uninitialized variable in alua_rtpg() @ 2016-04-14 9:39 ` Dan Carpenter 0 siblings, 0 replies; 33+ 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] 33+ messages in thread
* Re: [patch] scsi_dh_alua: uninitialized variable in alua_rtpg() 2016-04-14 9:39 ` Dan Carpenter (?) @ 2016-04-14 15:45 ` Bart Van Assche -1 siblings, 0 replies; 33+ messages in thread From: Bart Van Assche @ 2016-04-14 15:45 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Hannes Reinecke, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 04/14/2016 02:39 AM, Dan Carpenter wrote: > 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; Hello Dan, The code that uses the 'err' variable occurs in a loop. I think the initialization of 'err' should occur after the "retry:" label. Bart. ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch] scsi_dh_alua: uninitialized variable in alua_rtpg() @ 2016-04-14 15:45 ` Bart Van Assche 0 siblings, 0 replies; 33+ messages in thread From: Bart Van Assche @ 2016-04-14 15:45 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Hannes Reinecke, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 04/14/2016 02:39 AM, Dan Carpenter wrote: > 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; Hello Dan, The code that uses the 'err' variable occurs in a loop. I think the initialization of 'err' should occur after the "retry:" label. Bart. ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch] scsi_dh_alua: uninitialized variable in alua_rtpg() @ 2016-04-14 15:45 ` Bart Van Assche 0 siblings, 0 replies; 33+ messages in thread From: Bart Van Assche @ 2016-04-14 15:45 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Hannes Reinecke, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 04/14/2016 02:39 AM, Dan Carpenter wrote: > 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; Hello Dan, The code that uses the 'err' variable occurs in a loop. I think the initialization of 'err' should occur after the "retry:" label. Bart. ^ permalink raw reply [flat|nested] 33+ messages in thread
* [patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg() 2016-04-14 15:45 ` Bart Van Assche @ 2016-04-14 18:20 ` Dan Carpenter -1 siblings, 0 replies; 33+ messages in thread From: Dan Carpenter @ 2016-04-14 18:20 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. 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) { ^ permalink raw reply related [flat|nested] 33+ messages in thread
* [patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg() @ 2016-04-14 18:20 ` Dan Carpenter 0 siblings, 0 replies; 33+ messages in thread From: Dan Carpenter @ 2016-04-14 18:20 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. 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) { ^ permalink raw reply related [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg() 2016-04-14 18:20 ` Dan Carpenter (?) @ 2016-04-14 18:55 ` Bart Van Assche -1 siblings, 0 replies; 33+ messages in thread From: Bart Van Assche @ 2016-04-14 18:55 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Hannes Reinecke, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 04/14/2016 11:20 AM, Dan Carpenter wrote: > 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) { Although I would have preferred that that initialization would have been closer to the other 'err' assignments this patch looks fine to me. If this patch does not get integrated in kernel v4.6 a "Cc: stable" tag will be needed. Bart. ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg() @ 2016-04-14 18:55 ` Bart Van Assche 0 siblings, 0 replies; 33+ messages in thread From: Bart Van Assche @ 2016-04-14 18:55 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Hannes Reinecke, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 04/14/2016 11:20 AM, Dan Carpenter wrote: > 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) { Although I would have preferred that that initialization would have been closer to the other 'err' assignments this patch looks fine to me. If this patch does not get integrated in kernel v4.6 a "Cc: stable" tag will be needed. Bart. ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg() @ 2016-04-14 18:55 ` Bart Van Assche 0 siblings, 0 replies; 33+ messages in thread From: Bart Van Assche @ 2016-04-14 18:55 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Hannes Reinecke, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 04/14/2016 11:20 AM, Dan Carpenter wrote: > 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) { Although I would have preferred that that initialization would have been closer to the other 'err' assignments this patch looks fine to me. If this patch does not get integrated in kernel v4.6 a "Cc: stable" tag will be needed. Bart. ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg() 2016-04-14 18:20 ` Dan Carpenter (?) @ 2016-04-15 5:59 ` Hannes Reinecke -1 siblings, 0 replies; 33+ messages in thread From: Hannes Reinecke @ 2016-04-15 5:59 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 04/14/2016 08:20 PM, Dan Carpenter wrote: > 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) { > Reviewed-by: Hannes Reinecke <hare@suse.com> Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg() @ 2016-04-15 5:59 ` Hannes Reinecke 0 siblings, 0 replies; 33+ messages in thread From: Hannes Reinecke @ 2016-04-15 5:59 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 04/14/2016 08:20 PM, Dan Carpenter wrote: > 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) { > Reviewed-by: Hannes Reinecke <hare@suse.com> Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg() @ 2016-04-15 5:59 ` Hannes Reinecke 0 siblings, 0 replies; 33+ messages in thread From: Hannes Reinecke @ 2016-04-15 5:59 UTC (permalink / raw) To: Dan Carpenter, James E.J. Bottomley Cc: Martin K. Petersen, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On 04/14/2016 08:20 PM, Dan Carpenter wrote: > 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) { > Reviewed-by: Hannes Reinecke <hare@suse.com> Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg() 2016-04-14 18:20 ` Dan Carpenter @ 2016-04-15 20:26 ` Martin K. Petersen -1 siblings, 0 replies; 33+ messages in thread From: Martin K. Petersen @ 2016-04-15 20:26 UTC (permalink / raw) To: Dan Carpenter Cc: James E.J. Bottomley, Martin K. Petersen, Hannes Reinecke, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors >>>>> "Dan" = Dan Carpenter <dan.carpenter@oracle.com> writes: Dan> It's possible to use "err" without initializing it. If it happens Dan> to be a 2 which is SCSI_DH_RETRY then that could cause a bug. Bart Dan> Van Assche pointed out that we should probably re-initialize it for Dan> every iteration through the retry loop. Applied to 4.6/scsi-fixes. -- Martin K. Petersen Oracle Linux Engineering ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_rtpg() @ 2016-04-15 20:26 ` Martin K. Petersen 0 siblings, 0 replies; 33+ messages in thread From: Martin K. Petersen @ 2016-04-15 20:26 UTC (permalink / raw) To: Dan Carpenter Cc: James E.J. Bottomley, Martin K. Petersen, Hannes Reinecke, Bart Van Assche, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors >>>>> "Dan" == Dan Carpenter <dan.carpenter@oracle.com> writes: Dan> It's possible to use "err" without initializing it. If it happens Dan> to be a 2 which is SCSI_DH_RETRY then that could cause a bug. Bart Dan> Van Assche pointed out that we should probably re-initialize it for Dan> every iteration through the retry loop. Applied to 4.6/scsi-fixes. -- Martin K. Petersen Oracle Linux Engineering ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch] scsi_dh_alua: uninitialized variable in alua_rtpg() 2016-04-14 15:45 ` Bart Van Assche @ 2016-04-14 18:20 ` Dan Carpenter -1 siblings, 0 replies; 33+ messages in thread From: Dan Carpenter @ 2016-04-14 18:20 UTC (permalink / raw) To: Bart Van Assche Cc: James E.J. Bottomley, Martin K. Petersen, Hannes Reinecke, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On Thu, Apr 14, 2016 at 08:45:18AM -0700, Bart Van Assche wrote: > On 04/14/2016 02:39 AM, Dan Carpenter wrote: > >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; > > Hello Dan, > > The code that uses the 'err' variable occurs in a loop. I think the > initialization of 'err' should occur after the "retry:" label. It looks like you're right. I'll resend. I don't know this code very well, obviously and it's a static checker fix not something I have tested. regards, dan carpenter ^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [patch] scsi_dh_alua: uninitialized variable in alua_rtpg() @ 2016-04-14 18:20 ` Dan Carpenter 0 siblings, 0 replies; 33+ messages in thread From: Dan Carpenter @ 2016-04-14 18:20 UTC (permalink / raw) To: Bart Van Assche Cc: James E.J. Bottomley, Martin K. Petersen, Hannes Reinecke, Johannes Thumshirn, Ewan Milne, linux-scsi, linux-kernel, kernel-janitors On Thu, Apr 14, 2016 at 08:45:18AM -0700, Bart Van Assche wrote: > On 04/14/2016 02:39 AM, Dan Carpenter wrote: > >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; > > Hello Dan, > > The code that uses the 'err' variable occurs in a loop. I think the > initialization of 'err' should occur after the "retry:" label. It looks like you're right. I'll resend. I don't know this code very well, obviously and it's a static checker fix not something I have tested. regards, dan carpenter ^ permalink raw reply [flat|nested] 33+ messages in thread
end of thread, other threads:[~2016-04-15 20:26 UTC | newest] Thread overview: 33+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-03-11 10:17 [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd() Dan Carpenter 2016-03-11 10:17 ` Dan Carpenter 2016-03-11 10:50 ` Hannes Reinecke 2016-03-11 10:50 ` Hannes Reinecke 2016-03-11 10:50 ` Hannes Reinecke 2016-03-11 11:19 ` [patch v2] " Dan Carpenter 2016-03-11 11:19 ` Dan Carpenter 2016-03-11 11:48 ` Hannes Reinecke 2016-03-11 11:48 ` Hannes Reinecke 2016-03-11 11:48 ` Hannes Reinecke 2016-03-11 14:40 ` Manoj Kumar 2016-03-11 14:40 ` Manoj Kumar 2016-03-14 20:02 ` Martin K. Petersen 2016-03-14 20:02 ` Martin K. Petersen 2016-03-11 11:19 ` [patch] " Dan Carpenter 2016-03-11 11:19 ` Dan Carpenter 2016-04-14 9:39 ` [patch] scsi_dh_alua: uninitialized variable in alua_rtpg() Dan Carpenter 2016-04-14 9:39 ` Dan Carpenter 2016-04-14 15:45 ` Bart Van Assche 2016-04-14 15:45 ` Bart Van Assche 2016-04-14 15:45 ` Bart Van Assche 2016-04-14 18:20 ` [patch v2] " Dan Carpenter 2016-04-14 18:20 ` Dan Carpenter 2016-04-14 18:55 ` Bart Van Assche 2016-04-14 18:55 ` Bart Van Assche 2016-04-14 18:55 ` Bart Van Assche 2016-04-15 5:59 ` Hannes Reinecke 2016-04-15 5:59 ` Hannes Reinecke 2016-04-15 5:59 ` Hannes Reinecke 2016-04-15 20:26 ` Martin K. Petersen 2016-04-15 20:26 ` Martin K. Petersen 2016-04-14 18:20 ` [patch] " Dan Carpenter 2016-04-14 18:20 ` Dan Carpenter
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.