diff options
author | Kirill Korotaev <dev@openvz.org> | 2006-06-14 09:59:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-14 11:59:44 -0400 |
commit | 9cedc194a7735e5d74ad26d3825247dc65a4d98e (patch) | |
tree | 973541332ad3428448be7636eb78e2106aafb869 /fs/locks.c | |
parent | eb35cf60e462491249166182e3e755d3d5d91a28 (diff) |
[PATCH] Return error in case flock_lock_file failure
If flock_lock_file() failed to allocate flock with locks_alloc_lock()
then "error = 0" is returned. Need to return some non-zero.
Signed-off-by: Pavel Emelianov <xemul@openvz.org>
Signed-off-by: Kirill Korotaev <dev@openvz.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/locks.c')
-rw-r--r-- | fs/locks.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/locks.c b/fs/locks.c index 6f99c0a6f836..ab61a8b54829 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -755,6 +755,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) | |||
755 | if (request->fl_type == F_UNLCK) | 755 | if (request->fl_type == F_UNLCK) |
756 | goto out; | 756 | goto out; |
757 | 757 | ||
758 | error = -ENOMEM; | ||
758 | new_fl = locks_alloc_lock(); | 759 | new_fl = locks_alloc_lock(); |
759 | if (new_fl == NULL) | 760 | if (new_fl == NULL) |
760 | goto out; | 761 | goto out; |
@@ -781,6 +782,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) | |||
781 | locks_copy_lock(new_fl, request); | 782 | locks_copy_lock(new_fl, request); |
782 | locks_insert_lock(&inode->i_flock, new_fl); | 783 | locks_insert_lock(&inode->i_flock, new_fl); |
783 | new_fl = NULL; | 784 | new_fl = NULL; |
785 | error = 0; | ||
784 | 786 | ||
785 | out: | 787 | out: |
786 | unlock_kernel(); | 788 | unlock_kernel(); |