summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2014-12-29 14:00:18 +0100
committerEric Van Hensbergen <ericvh@gmail.com>2015-03-20 15:34:41 +0100
commitad80492df56b4bd2d4da9990678d87b66af42f54 (patch)
treeaa02c96f89e27cb126ed0ee8344c683efb3e732c
parent9p: remove unused variable in p9_fd_create() (diff)
downloadlinux-ad80492df56b4bd2d4da9990678d87b66af42f54.tar.xz
linux-ad80492df56b4bd2d4da9990678d87b66af42f54.zip
9p: fix error handling in v9fs_file_do_lock
p9_client_lock_dotl() doesn't set status if p9_client_rpc() fails. It can lead to 'default:' case in switch below and kernel crashes. Let's bypass the switch if p9_client_lock_dotl() fails. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
-rw-r--r--fs/9p/vfs_file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index b40133796b87..8d29e1e03dfa 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -194,7 +194,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
for (;;) {
res = p9_client_lock_dotl(fid, &flock, &status);
if (res < 0)
- break;
+ goto out_unlock;
if (status != P9_LOCK_BLOCKED)
break;
@@ -220,6 +220,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
BUG();
}
+out_unlock:
/*
* incase server returned error for lock request, revert
* it locally