All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	"James E.J. Bottomley" <JBottomley@odin.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Bart Van Assche <bart.vanassche@sandisk.com>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	Ewan Milne <emilne@redhat.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd()
Date: Fri, 11 Mar 2016 10:50:30 +0000	[thread overview]
Message-ID: <56E2A2F6.30308@suse.de> (raw)
In-Reply-To: <20160311101756.GA9384@mwanda>

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

WARNING: multiple messages have this Message-ID (diff)
From: Hannes Reinecke <hare@suse.de>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	"James E.J. Bottomley" <JBottomley@odin.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Bart Van Assche <bart.vanassche@sandisk.com>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	Ewan Milne <emilne@redhat.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd()
Date: Fri, 11 Mar 2016 11:50:30 +0100	[thread overview]
Message-ID: <56E2A2F6.30308@suse.de> (raw)
In-Reply-To: <20160311101756.GA9384@mwanda>

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

WARNING: multiple messages have this Message-ID (diff)
From: Hannes Reinecke <hare@suse.de>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	"James E.J. Bottomley" <JBottomley@odin.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Bart Van Assche <bart.vanassche@sandisk.com>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	Ewan Milne <emilne@redhat.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd()
Date: Fri, 11 Mar 2016 11:50:30 +0100	[thread overview]
Message-ID: <56E2A2F6.30308@suse.de> (raw)
In-Reply-To: <20160311101756.GA9384@mwanda>

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)

  reply	other threads:[~2016-03-11 10:50 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56E2A2F6.30308@suse.de \
    --to=hare@suse.de \
    --cc=JBottomley@odin.com \
    --cc=bart.vanassche@sandisk.com \
    --cc=dan.carpenter@oracle.com \
    --cc=emilne@redhat.com \
    --cc=jthumshirn@suse.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.