diff options
Diffstat (limited to 'fs/locks.c')
-rw-r--r-- | fs/locks.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/locks.c b/fs/locks.c index 4f441e46cef4..814c51d0de47 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -1636,12 +1636,13 @@ EXPORT_SYMBOL(flock_lock_file_wait); | |||
1636 | SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd) | 1636 | SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd) |
1637 | { | 1637 | { |
1638 | struct file *filp; | 1638 | struct file *filp; |
1639 | int fput_needed; | ||
1639 | struct file_lock *lock; | 1640 | struct file_lock *lock; |
1640 | int can_sleep, unlock; | 1641 | int can_sleep, unlock; |
1641 | int error; | 1642 | int error; |
1642 | 1643 | ||
1643 | error = -EBADF; | 1644 | error = -EBADF; |
1644 | filp = fget(fd); | 1645 | filp = fget_light(fd, &fput_needed); |
1645 | if (!filp) | 1646 | if (!filp) |
1646 | goto out; | 1647 | goto out; |
1647 | 1648 | ||
@@ -1674,7 +1675,7 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd) | |||
1674 | locks_free_lock(lock); | 1675 | locks_free_lock(lock); |
1675 | 1676 | ||
1676 | out_putf: | 1677 | out_putf: |
1677 | fput(filp); | 1678 | fput_light(filp, fput_needed); |
1678 | out: | 1679 | out: |
1679 | return error; | 1680 | return error; |
1680 | } | 1681 | } |