From: Hannes Reinecke Date: Fri, 11 Mar 2016 10:50:30 +0000 Subject: Re: [patch] scsi_dh_alua: uninitialized variable in alua_check_vpd() Message-Id: <56E2A2F6.30308@suse.de> List-Id: References: <20160311101756.GA9384@mwanda> In-Reply-To: <20160311101756.GA9384@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Dan Carpenter , "James E.J. Bottomley" Cc: "Martin K. Petersen" , Bart Van Assche , Johannes Thumshirn , Ewan Milne , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org 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. >=20 > Fixes: cb0a168cb6b8 ('scsi_dh_alua: update 'access_state' field') > Signed-off-by: Dan Carpenter >=20 > diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/de= vice_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, s= truct alua_dh_data *h, > { > int rel_port =3D -1, group_id; > struct alua_port_group *pg, *old_pg =3D NULL; > - bool pg_updated; > + bool pg_updated =3D 0; > unsigned long flags; > =20 > group_id =3D scsi_vpd_tpg_id(sdev, &rel_port); >=20 I'd prefer 'pg_updated =3D false'. Not that we trip over a static code analyser here :-) Cheers, Hannes --=20 Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N=FCrnberg GF: F. Imend=F6rffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG N=FCrnberg) -- 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