diff mbox

[v2] scsi_dh_alua: uninitialized variable in alua_check_vpd()

Message ID 20160311111903.GA12332@mwanda (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Dan Carpenter March 11, 2016, 11:19 a.m. UTC
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>

--
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

Comments

Hannes Reinecke March 11, 2016, 11:48 a.m. UTC | #1
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
Manoj Kumar March 11, 2016, 2:40 p.m. UTC | #2
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


--
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
Martin K. Petersen March 14, 2016, 8:02 p.m. UTC | #3
>>>>> "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.
diff mbox

Patch

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);