summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2008-10-20 19:23:53 +0200
committerMark Fasheh <mfasheh@suse.com>2008-11-10 09:51:46 -0800
commit87cfa004321c62aec681713ea48e0b846336d9f4 (patch)
tree6ce76f2d2d97d8e9edf100d4c8561b8dcde338d4 /fs
parentfa38e92cb34e27e60d0faf1035934eb9b44aa1d4 (diff)
downloadlinux-87cfa004321c62aec681713ea48e0b846336d9f4.tar.bz2
ocfs2: Fix checking of return value of new_inode()
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/namei.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index 485a6aa0ad39..f594f300d4cd 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -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;
}