aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-10-30 16:59:08 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-11-06 08:59:42 -0500
commit26d83dedf61d26d85f10bc34b92f4de7660fd746 (patch)
tree69fc1d3ccc85fa25b5506e826aad90e6fd3d8f6f
parent4a221953ed121692aa25998451a57c7f4be8b4f6 (diff)
downloadkernel_samsung_smdk4412-26d83dedf61d26d85f10bc34b92f4de7660fd746.zip
kernel_samsung_smdk4412-26d83dedf61d26d85f10bc34b92f4de7660fd746.tar.gz
kernel_samsung_smdk4412-26d83dedf61d26d85f10bc34b92f4de7660fd746.tar.bz2
[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>
-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 57c43ac..d470e52 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);