]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.fixes/ocfs2-Fix-checking-of-return-value-of-new_inode.patch
Reenabled linux-xen, added patches for Xen Kernel Version 2.6.27.31,
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / ocfs2-Fix-checking-of-return-value-of-new_inode.patch
1 From: Jan Kara <jack@suse.cz>
2 Date: Mon, 20 Oct 2008 19:23:53 +0200
3 Subject: ocfs2: Fix checking of return value of new_inode()
4
5 new_inode() does not return ERR_PTR() but NULL in case of failure. Correct
6 checking of the return value.
7
8 Signed-off-by: Jan Kara <jack@suse.cz>
9 Signed-off-by: Joel Becker <joel.becker@oracle.com>
10 Signed-off-by: Mark Fasheh <mfasheh@suse.com>
11 ---
12 fs/ocfs2/namei.c | 4 ++--
13 1 files changed, 2 insertions(+), 2 deletions(-)
14
15 Index: linux-2.6.27-ocfs2/fs/ocfs2/namei.c
16 ===================================================================
17 --- linux-2.6.27-ocfs2.orig/fs/ocfs2/namei.c
18 +++ linux-2.6.27-ocfs2/fs/ocfs2/namei.c
19 @@ -378,8 +378,8 @@ static int ocfs2_mknod_locked(struct ocf
20 }
21
22 inode = new_inode(dir->i_sb);
23 - if (IS_ERR(inode)) {
24 - status = PTR_ERR(inode);
25 + if (!inode) {
26 + status = -ENOMEM;
27 mlog(ML_ERROR, "new_inode failed!\n");
28 goto leave;
29 }