summaryrefslogtreecommitdiff
path: root/super-ddf.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-04-09 16:59:49 +1000
committerNeilBrown <neilb@suse.de>2014-05-21 11:54:47 +1000
commit0d255ff84e2f679a9c8ad190b5c3238e62fca5cb (patch)
tree6d61c7b45d39540f0fabe5d0e052f8a35a2cb951 /super-ddf.c
parentd2ec75fb3ef359ccd6eb35dd9e9ce60430b8ebe9 (diff)
DDF: avoid ref outside array in getinfo_super_ddf_bvd
As we are range-checking 'cd', there is a chance that it is not in-range. In that case we should include all array indexes with 'cd' inside the range-tested branch. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-ddf.c')
-rw-r--r--super-ddf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/super-ddf.c b/super-ddf.c
index f982460b..414bdef2 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -2074,11 +2074,11 @@ static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info, cha
info->component_size = vc->block_sizes[cd];
else
info->component_size = be64_to_cpu(conf->blocks);
- }
- for (dl = ddf->dlist; dl ; dl = dl->next)
- if (be32_eq(dl->disk.refnum, conf->phys_refnum[cd]))
- break;
+ for (dl = ddf->dlist; dl ; dl = dl->next)
+ if (be32_eq(dl->disk.refnum, conf->phys_refnum[cd]))
+ break;
+ }
info->disk.major = 0;
info->disk.minor = 0;