summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/aops.c
diff options
context:
space:
mode:
authorDaniel DeFreez <dcdefreez@ucdavis.edu>2016-04-20 01:57:45 +0200
committerBob Peterson <rpeterso@redhat.com>2016-04-20 01:59:11 +0200
commit9c7fe83530a351845719acf1dda0587e8c743588 (patch)
tree1a0dcd287ce43cfab52529bfab7f4c7a4ce9535b /fs/gfs2/aops.c
parentGFS2: Don't dereference inode in gfs2_inode_lookup until it's valid (diff)
downloadlinux-9c7fe83530a351845719acf1dda0587e8c743588.tar.xz
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/aops.c')
-rw-r--r--fs/gfs2/aops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index aa016e4b8bec..58dd0061134b 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -1063,7 +1063,7 @@ static ssize_t gfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
gfs2_holder_init(ip->i_gl, LM_ST_DEFERRED, 0, &gh);
rv = gfs2_glock_nq(&gh);
if (rv)
- return rv;
+ goto out_uninit;
rv = gfs2_ok_for_dio(ip, offset);
if (rv != 1)
goto out; /* dio not valid, fall back to buffered i/o */
@@ -1102,6 +1102,7 @@ static ssize_t gfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter,
offset, gfs2_get_block_direct, NULL, NULL, 0);
out:
gfs2_glock_dq(&gh);
+out_uninit:
gfs2_holder_uninit(&gh);
return rv;
}