aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/affs/bitmap.c3
-rw-r--r--fs/afs/server.c3
-rw-r--r--fs/afs/super.c4
3 files changed, 3 insertions, 7 deletions
diff --git a/fs/affs/bitmap.c b/fs/affs/bitmap.c
index b0b953683c1a..b330009fe42d 100644
--- a/fs/affs/bitmap.c
+++ b/fs/affs/bitmap.c
@@ -289,12 +289,11 @@ int affs_init_bitmap(struct super_block *sb, int *flags)
289 sbi->s_bmap_count = (sbi->s_partition_size - sbi->s_reserved + 289 sbi->s_bmap_count = (sbi->s_partition_size - sbi->s_reserved +
290 sbi->s_bmap_bits - 1) / sbi->s_bmap_bits; 290 sbi->s_bmap_bits - 1) / sbi->s_bmap_bits;
291 size = sbi->s_bmap_count * sizeof(*bm); 291 size = sbi->s_bmap_count * sizeof(*bm);
292 bm = sbi->s_bitmap = kmalloc(size, GFP_KERNEL); 292 bm = sbi->s_bitmap = kzalloc(size, GFP_KERNEL);
293 if (!sbi->s_bitmap) { 293 if (!sbi->s_bitmap) {
294 printk(KERN_ERR "AFFS: Bitmap allocation failed\n"); 294 printk(KERN_ERR "AFFS: Bitmap allocation failed\n");
295 return -ENOMEM; 295 return -ENOMEM;
296 } 296 }
297 memset(sbi->s_bitmap, 0, size);
298 297
299 bmap_blk = (__be32 *)sbi->s_root_bh->b_data; 298 bmap_blk = (__be32 *)sbi->s_root_bh->b_data;
300 blk = sb->s_blocksize / 4 - 49; 299 blk = sb->s_blocksize / 4 - 49;
diff --git a/fs/afs/server.c b/fs/afs/server.c
index 22afaae1a4ce..44aff81dc6a7 100644
--- a/fs/afs/server.c
+++ b/fs/afs/server.c
@@ -55,13 +55,12 @@ int afs_server_lookup(struct afs_cell *cell, const struct in_addr *addr,
55 _enter("%p,%08x,", cell, ntohl(addr->s_addr)); 55 _enter("%p,%08x,", cell, ntohl(addr->s_addr));
56 56
57 /* allocate and initialise a server record */ 57 /* allocate and initialise a server record */
58 server = kmalloc(sizeof(struct afs_server), GFP_KERNEL); 58 server = kzalloc(sizeof(struct afs_server), GFP_KERNEL);
59 if (!server) { 59 if (!server) {
60 _leave(" = -ENOMEM"); 60 _leave(" = -ENOMEM");
61 return -ENOMEM; 61 return -ENOMEM;
62 } 62 }
63 63
64 memset(server, 0, sizeof(struct afs_server));
65 atomic_set(&server->usage, 1); 64 atomic_set(&server->usage, 1);
66 65
67 INIT_LIST_HEAD(&server->link); 66 INIT_LIST_HEAD(&server->link);
diff --git a/fs/afs/super.c b/fs/afs/super.c
index 9a351c4c7564..18d9b77ba40f 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -242,14 +242,12 @@ static int afs_fill_super(struct super_block *sb, void *data, int silent)
242 kenter(""); 242 kenter("");
243 243
244 /* allocate a superblock info record */ 244 /* allocate a superblock info record */
245 as = kmalloc(sizeof(struct afs_super_info), GFP_KERNEL); 245 as = kzalloc(sizeof(struct afs_super_info), GFP_KERNEL);
246 if (!as) { 246 if (!as) {
247 _leave(" = -ENOMEM"); 247 _leave(" = -ENOMEM");
248 return -ENOMEM; 248 return -ENOMEM;
249 } 249 }
250 250
251 memset(as, 0, sizeof(struct afs_super_info));
252
253 afs_get_volume(params->volume); 251 afs_get_volume(params->volume);
254 as->volume = params->volume; 252 as->volume = params->volume;
255 253