mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-24 21:24:00 +08:00
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>
This commit is contained in:
parent
9bfc52c109
commit
ad80492df5
@ -194,7 +194,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
res = p9_client_lock_dotl(fid, &flock, &status);
|
res = p9_client_lock_dotl(fid, &flock, &status);
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
break;
|
goto out_unlock;
|
||||||
|
|
||||||
if (status != P9_LOCK_BLOCKED)
|
if (status != P9_LOCK_BLOCKED)
|
||||||
break;
|
break;
|
||||||
@ -220,6 +220,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)
|
|||||||
BUG();
|
BUG();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out_unlock:
|
||||||
/*
|
/*
|
||||||
* incase server returned error for lock request, revert
|
* incase server returned error for lock request, revert
|
||||||
* it locally
|
* it locally
|
||||||
|
Loading…
Reference in New Issue
Block a user