summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-10-30 22:59:08 +0100
committerSteven Whitehouse <swhiteho@redhat.com>2006-11-06 14:59:42 +0100
commit26d83dedf61d26d85f10bc34b92f4de7660fd746 (patch)
tree69fc1d3ccc85fa25b5506e826aad90e6fd3d8f6f /fs/gfs2/inode.c
parent[GFS2] Fix incorrect fs sync behaviour. (diff)
downloadlinux-26d83dedf61d26d85f10bc34b92f4de7660fd746.tar.xz
linux-26d83dedf61d26d85f10bc34b92f4de7660fd746.zip
[GFS2] Fix OOM error handling
Fix the OOM error handling in inode.c where it was possible for a NULL pointer to be dereferenced. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 57c43ac47925..d470e5286ecd 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -157,6 +157,9 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, struct gfs2_inum *inum,
struct gfs2_glock *io_gl;
int error;
+ if (!inode)
+ return ERR_PTR(-ENOBUFS);
+
if (inode->i_state & I_NEW) {
struct gfs2_sbd *sdp = GFS2_SB(inode);
umode_t mode = DT2IF(type);