From 95eeceeb32775bffd06771c81c3dee547af0d62f Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 8 Jun 2011 15:54:13 +1000 Subject: getinfo_super now clears the 'info' structure before filling it in. Some code currently clears 'info' before calling getinfo_super, some code doesn't. To be consistent, change it so no caller ever clears 'info', but ever getinfo_super function must clear it. Note that ->raid_disk may be meaningful if that 'map' is passed non-NULL. In that case it is copied out before the structure is zeroed. Signed-off-by: NeilBrown --- super0.c | 1 + 1 file changed, 1 insertion(+) (limited to 'super0.c') diff --git a/super0.c b/super0.c index 2c27e1e1..440981ba 100644 --- a/super0.c +++ b/super0.c @@ -346,6 +346,7 @@ static void getinfo_super0(struct supertype *st, struct mdinfo *info, char *map) int i; int map_disks = info->array.raid_disks; + memset(info, 0, sizeof(*info)); info->array.major_version = sb->major_version; info->array.minor_version = sb->minor_version; info->array.patch_version = sb->patch_version; -- cgit v1.2.3