]> git.ipfire.org Git - thirdparty/mdadm.git/commit - mdopen.c
make_parts(): Fix case of comparing against uninitialized variables
authorJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 1 Nov 2011 19:30:12 +0000 (20:30 +0100)
committerNeilBrown <neilb@suse.de>
Wed, 2 Nov 2011 00:18:53 +0000 (11:18 +1100)
commit96ae5973dda6f6f6487c74b5f3944720a5b9d21f
tree07ce91ff563e187d7c0fd8183356067efa825b54
parentb2916f251404433aa1eafd36cdb9e19a692f2269
make_parts(): Fix case of comparing against uninitialized variables

Silencing gcc's warning of uninitialized variables was hiding a bug
where if we have /dev/md64 as a symlink, and /dev/md64p1 was a real
device node.

In this case major_num and minor_num would not get populated, but we
end up comparing against them because the stat for md64p1 succeeds.

Instead of using the int foo = foo trick, change the code to set
set the variables to invalid values so comparisons will fail.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
mdopen.c