Skip to content

Commit

Permalink
[GFS2] fs/gfs2/ops_fstype.c:fill_super_meta(): fix NULL dereference
Browse files Browse the repository at this point in the history
Don't dereference new->s_root when we do know it's NULL.

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Adrian Bunk authored and Steven Whitehouse committed Oct 20, 2006
1 parent 348acd4 commit bbbe451
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/gfs2/ops_fstype.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bbbe451

Please sign in to comment.