From: Adrian Bunk Date: Thu, 19 Oct 2006 13:27:00 +0000 (+0200) Subject: [GFS2] fs/gfs2/ops_fstype.c:fill_super_meta(): fix NULL dereference X-Git-Tag: v2.6.19-rc3~43^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbbe4512735eb0f15f09ffd14876091a8e91bc69;p=linux-2.6 [GFS2] fs/gfs2/ops_fstype.c:fill_super_meta(): fix NULL dereference Don't dereference new->s_root when we do know it's NULL. Spotted by the Coverity checker. Signed-off-by: Adrian Bunk Signed-off-by: Steven Whitehouse --- diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index e99444dffe..882873a6bd 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -794,8 +794,8 @@ static int fill_super_meta(struct super_block *sb, struct super_block *new, fs_err(sdp, "can't get root dentry\n"); error = -ENOMEM; iput(inode); - } - new->s_root->d_op = &gfs2_dops; + } else + new->s_root->d_op = &gfs2_dops; return error; }