summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/file.c
diff options
context:
space:
mode:
authorDaniel DeFreez2016-04-20 01:57:45 +0200
committerBob Peterson2016-04-20 01:59:11 +0200
commit9c7fe83530a351845719acf1dda0587e8c743588 (patch)
tree1a0dcd287ce43cfab52529bfab7f4c7a4ce9535b /fs/gfs2/file.c
parentGFS2: Don't dereference inode in gfs2_inode_lookup until it's valid (diff)
downloadkernel-qcow2-linux-9c7fe83530a351845719acf1dda0587e8c743588.tar.gz
kernel-qcow2-linux-9c7fe83530a351845719acf1dda0587e8c743588.tar.xz
kernel-qcow2-linux-9c7fe83530a351845719acf1dda0587e8c743588.zip
GFS2: Add calls to gfs2_holder_uninit in two error handlers
This patch fixes two locations that do not call gfs2_holder_uninit if gfs2_glock_nq returns an error. Signed-off-by: Daniel DeFreez <dcdefreez@ucdavis.edu> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/file.c')
-rw-r--r--fs/gfs2/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index fd9a10e4518d..f33fd92e5f49 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -160,7 +160,7 @@ static int gfs2_get_flags(struct file *filp, u32 __user *ptr)
gfs2_holder_init(ip->i_gl, LM_ST_SHARED, 0, &gh);
error = gfs2_glock_nq(&gh);
if (error)
- return error;
+ goto out_uninit;
fsflags = fsflags_cvt(gfs2_to_fsflags, ip->i_diskflags);
if (!S_ISDIR(inode->i_mode) && ip->i_diskflags & GFS2_DIF_JDATA)
@@ -169,6 +169,7 @@ static int gfs2_get_flags(struct file *filp, u32 __user *ptr)
error = -EFAULT;
gfs2_glock_dq(&gh);
+out_uninit:
gfs2_holder_uninit(&gh);
return error;
}