aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
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 /fs/gfs2/inode.c
parent4a221953ed121692aa25998451a57c7f4be8b4f6 (diff)
[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,
157 struct gfs2_glock *io_gl; 157 struct gfs2_glock *io_gl;
158 int error; 158 int error;
159 159
160 if (!inode)
161 return ERR_PTR(-ENOBUFS);
162
160 if (inode->i_state & I_NEW) { 163 if (inode->i_state & I_NEW) {
161 struct gfs2_sbd *sdp = GFS2_SB(inode); 164 struct gfs2_sbd *sdp = GFS2_SB(inode);
162 umode_t mode = DT2IF(type); 165 umode_t mode = DT2IF(type);