* [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd()
@ 2016-03-11 10:17 Dan Carpenter
2016-03-11 10:50 ` Hannes Reinecke
0 siblings, 1 reply; 7+ 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] 7+ messages in thread
* Re: [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd()
2016-03-11 10:17 [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd() Dan Carpenter
@ 2016-03-11 10:50 ` Hannes Reinecke
2016-03-11 11:19 ` [patch v2] " Dan Carpenter
2016-03-11 11:19 ` [patch] " Dan Carpenter
0 siblings, 2 replies; 7+ 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] 7+ 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
2016-03-11 11:48 ` Hannes Reinecke
` (2 more replies)
2016-03-11 11:19 ` [patch] " Dan Carpenter
1 sibling, 3 replies; 7+ 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] 7+ 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 ` [patch v2] " Dan Carpenter
@ 2016-03-11 11:19 ` Dan Carpenter
1 sibling, 0 replies; 7+ 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] 7+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_check_vpd()
2016-03-11 11:19 ` [patch v2] " Dan Carpenter
@ 2016-03-11 11:48 ` Hannes Reinecke
2016-03-11 14:40 ` Manoj Kumar
2016-03-14 20:02 ` Martin K. Petersen
2 siblings, 0 replies; 7+ 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] 7+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_check_vpd()
2016-03-11 11:19 ` [patch v2] " Dan Carpenter
2016-03-11 11:48 ` Hannes Reinecke
@ 2016-03-11 14:40 ` Manoj Kumar
2016-03-14 20:02 ` Martin K. Petersen
2 siblings, 0 replies; 7+ 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] 7+ messages in thread
* Re: [patch v2] scsi_dh_alua: uninitialized variable in alua_check_vpd()
2016-03-11 11:19 ` [patch v2] " Dan Carpenter
2016-03-11 11:48 ` Hannes Reinecke
2016-03-11 14:40 ` Manoj Kumar
@ 2016-03-14 20:02 ` Martin K. Petersen
2 siblings, 0 replies; 7+ 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] 7+ messages in thread
end of thread, other threads:[~2016-03-14 20:02 UTC | newest]
Thread overview: 7+ 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:50 ` Hannes Reinecke
2016-03-11 11:19 ` [patch v2] " Dan Carpenter
2016-03-11 11:48 ` Hannes Reinecke
2016-03-11 14:40 ` Manoj Kumar
2016-03-14 20:02 ` Martin K. Petersen
2016-03-11 11:19 ` [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).