diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-10-30 16:59:08 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-11-06 08:59:42 -0500 |
commit | 26d83dedf61d26d85f10bc34b92f4de7660fd746 (patch) | |
tree | 69fc1d3ccc85fa25b5506e826aad90e6fd3d8f6f /fs/gfs2/inode.c | |
parent | 4a221953ed121692aa25998451a57c7f4be8b4f6 (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.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 57c43ac4792..d470e5286ec 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); |