Skip to contentSkip to conversation

correction to super_block cleanups

PATCH New Brian Gerst 1 participant 1 message Mar 13, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 correction to super_block cleanups

I forgot to zero out the newly allocated memory in the previous patches.
First patch is for the changes included in 2.5.7-pre1, second is
incremental to the ext2 and ncp patches.

Signature · 1 line
						Brian Gerst
fs/cramfs/inode.c +1 -0
diff -ruN linux/fs/cramfs/inode.c linux2/fs/cramfs/inode.c
@@ -201,6 +201,7 @@
 	if (!sbi)
 		return -ENOMEM;
 	sb->u.generic_sbp = sbi;
+	memset(sbi, 0, sizeof(struct cramfs_sb_info));
 
 	sb_set_blocksize(sb, PAGE_CACHE_SIZE);
 
fs/minix/inode.c +1 -0
diff -ruN linux/fs/minix/inode.c linux2/fs/minix/inode.c
@@ -178,6 +178,7 @@
 	if (!sbi)
 		return -ENOMEM;
 	s->u.generic_sbp = sbi;
+	memset(sbi, 0, sizeof(struct minix_sb_info));
 
 	/* N.B. These should be compile-time tests.
 	   Unfortunately that is impossible. */
fs/ext2/super.c +1 -0
diff -ruN linux/fs/ext2/super.c linux2/fs/ext2/super.c
@@ -469,6 +469,7 @@
 	if (!sbi)
 		return -ENOMEM;
 	sb->u.generic_sbp = sbi;
+	memset(sbi, 0, sizeof(struct ext2_super_block));
 
 	/*
 	 * See what the current blocksize for the device is, and
fs/ncpfs/inode.c +2 -0
diff -ruN linux/fs/ncpfs/inode.c linux2/fs/ncpfs/inode.c
@@ -319,6 +319,8 @@
 	if (!server)
 		return -ENOMEM;
 	sb->u.generic_sbp = server;
+	memset(server, 0, sizeof(struct ncp_server));
+
 	error = -EFAULT;
 	if (raw_data == NULL)
 		goto out;