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: MMI-PSA29.97-13-9~45515^2~47^2~10^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bbbe4512735eb0f15f09ffd14876091a8e91bc69;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [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 e99444dffeb8..882873a6bd69 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; }