lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 20 Feb 2013 23:18:45 +0100
From:	Paul Menzel <pm.debian@...glemail.com>
To:	Tim Gardner <tim.gardner@...onical.com>
Cc:	linux-kernel@...r.kernel.org, Alasdair Kergon <agk@...hat.com>,
	dm-devel@...hat.com, Neil Brown <neilb@...e.de>,
	linux-raid@...r.kernel.org
Subject: Re: [PATCH linux-next] DM RAID: validate_raid_redundancy: Silence
 uninitialized variable warning

Dear Tim,


Am Mittwoch, den 20.02.2013, 23:16 +0100 schrieb Paul Menzel:

> Am Mittwoch, den 20.02.2013, 13:31 -0700 schrieb Tim Gardner:
> 
> Noting the `gcc` version and build environment is never wrong. ;-)
> 
> > drivers/md/dm-raid.c: In function 'raid_ctr':
> > drivers/md/dm-raid.c:453:53: warning: 'rebuilds_per_group' may be used uninitialized in this function [-Wuninitialized]
> > drivers/md/dm-raid.c:383:11: note: 'rebuilds_per_group' was declared here
> > 
> > It appears unlikely that rebuilds_per_group could be used before set,
> 
> Why? Otherwise the compiler would not complain, right?
> 
> > but set it to 0 anyways just to shutup GCC.
> 
> Unfortunately I do not know what linux-next version you tested, so the
> line numbers are off in.
> 
>         $ git describe
>         v3.7.5-4-g9c2ab66

See below …

> > Cc: Alasdair Kergon <agk@...hat.com>
> > Cc: dm-devel@...hat.com
> > Cc: Neil Brown <neilb@...e.de>
> > Cc: linux-raid@...r.kernel.org
> > Signed-off-by: Tim Gardner <tim.gardner@...onical.com>
> > ---
> >  drivers/md/dm-raid.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
> > index 9d6bf19..8005caf 100644

Git to the rescue. I guess I should be able to find that commit to make
sense of the line numbers.

> > --- a/drivers/md/dm-raid.c
> > +++ b/drivers/md/dm-raid.c
> > @@ -380,7 +380,7 @@ static int validate_region_size(struct raid_set *rs, unsigned long region_size)
> >  static int validate_raid_redundancy(struct raid_set *rs)
> >  {
> >  	unsigned i, rebuild_cnt = 0;
> > -	unsigned rebuilds_per_group, copies, d;
> > +	unsigned rebuilds_per_group = 0, copies, d;
> >  	unsigned group_size, last_group_start;
> >  
> >  	for (i = 0; i < rs->md.raid_disks; i++)


Thanks,

Paul

Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ