Skip to content

Commit

Permalink
ocfs2: Fix checking of return value of new_inode()
Browse files Browse the repository at this point in the history
new_inode() does not return ERR_PTR() but NULL in case of failure. Correct
checking of the return value.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
  • Loading branch information
Jan Kara authored and Mark Fasheh committed Nov 10, 2008
1 parent fa38e92 commit 87cfa00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ocfs2/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ static int ocfs2_mknod_locked(struct ocfs2_super *osb,
}

inode = new_inode(dir->i_sb);
if (IS_ERR(inode)) {
status = PTR_ERR(inode);
if (!inode) {
status = -ENOMEM;
mlog(ML_ERROR, "new_inode failed!\n");
goto leave;
}
Expand Down

0 comments on commit 87cfa00

Please sign in to comment.