From be4f245dbbbc1f37370ab463cd4892acf4a1222b Mon Sep 17 00:00:00 2001 From: Bob Peterson Date: Fri, 16 Nov 2012 09:11:39 -0500 Subject: [PATCH] GFS2: add error check while allocating new inodes This patch adds a return code check after attempting to allocate a new inode during dinode creation. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse --- fs/gfs2/inode.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index e321333..2405695 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -674,6 +674,10 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, goto fail_gunlock; inode = new_inode(sdp->sd_vfs); + if (!inode) { + gfs2_glock_dq_uninit(ghs); + return -ENOMEM; + } ip = GFS2_I(inode); error = gfs2_rs_alloc(ip); if (error) -- 2.7.4