--- /dev/null
+From: Jan Kara <jack@suse.cz>
+Date: Mon, 20 Oct 2008 19:23:53 +0200
+Subject: 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>
+---
+ fs/ocfs2/namei.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+Index: linux-2.6.27-ocfs2/fs/ocfs2/namei.c
+===================================================================
+--- linux-2.6.27-ocfs2.orig/fs/ocfs2/namei.c
++++ linux-2.6.27-ocfs2/fs/ocfs2/namei.c
+@@ -378,8 +378,8 @@ static int ocfs2_mknod_locked(struct ocf
+ }
+
+ 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;
+ }