From: Steven Whitehouse Date: Mon, 30 Oct 2006 21:59:08 +0000 (-0500) Subject: [GFS2] Fix OOM error handling X-Git-Tag: v2.6.19-rc5~7^2~2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=26d83dedf61d26d85f10bc34b92f4de7660fd746;p=linux-2.6-omap-h63xx.git [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 --- 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);