summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2012-11-16 15:11:39 +0100
committerSteven Whitehouse <swhiteho@redhat.com>2012-11-16 15:26:57 +0100
commitbe4f245dbbbc1f37370ab463cd4892acf4a1222b (patch)
tree1083158e3402b549f7acd5cb99fae87f53e03db1 /fs/gfs2/inode.c
parentGFS2: don't reference inode's glock during block allocation trace (diff)
downloadlinux-be4f245dbbbc1f37370ab463cd4892acf4a1222b.tar.xz
linux-be4f245dbbbc1f37370ab463cd4892acf4a1222b.zip
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 <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index e321333f0b4c..2405695febe9 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)