public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [patch]check NULL pointer
@ 2011-06-09  3:31 Shaohua Li
  2011-06-09  9:24 ` Lukas Czerner
  0 siblings, 1 reply; 10+ messages in thread
From: Shaohua Li @ 2011-06-09  3:31 UTC (permalink / raw)
  To: linux-ext4; +Cc: Ted Ts'o

orig_data could be NULL.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index cc5c157..45fc255 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3057,6 +3057,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 	unsigned int journal_ioprio = DEFAULT_JOURNAL_IOPRIO;
 	ext4_group_t first_not_zeroed;
 
+	if (!orig_data)
+		return ret;
 	sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
 	if (!sbi)
 		goto out_free_orig;
@@ -4285,6 +4287,8 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
 #endif
 	char *orig_data = kstrdup(data, GFP_KERNEL);
 
+	if (!orig_data)
+		return -ENOMEM;
 	/* Store the original options */
 	lock_super(sb);
 	old_sb_flags = sb->s_flags;



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-06-14 10:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-09  3:31 [patch]check NULL pointer Shaohua Li
2011-06-09  9:24 ` Lukas Czerner
2011-06-09 14:51   ` Eric Sandeen
2011-06-10  6:34     ` Shaohua Li
2011-06-10  8:32       ` Lukas Czerner
2011-06-13  7:30         ` Shaohua Li
2011-06-13  9:20           ` Lukas Czerner
2011-06-13 21:02             ` Ted Ts'o
2011-06-14  0:31             ` Shaohua Li
2011-06-14 10:07               ` Lukas Czerner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox