diff options
| -rw-r--r-- | fs/locks.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/locks.c b/fs/locks.c index 4ce087cca501..cb66fb05ad4a 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
| @@ -1761,13 +1761,10 @@ static int do_fcntl_add_lease(unsigned int fd, struct file *filp, long arg) | |||
| 1761 | ret = fl; | 1761 | ret = fl; |
| 1762 | spin_lock(&inode->i_lock); | 1762 | spin_lock(&inode->i_lock); |
| 1763 | error = __vfs_setlease(filp, arg, &ret); | 1763 | error = __vfs_setlease(filp, arg, &ret); |
| 1764 | if (error) { | 1764 | if (error) |
| 1765 | spin_unlock(&inode->i_lock); | 1765 | goto out_unlock; |
| 1766 | locks_free_lock(fl); | 1766 | if (ret == fl) |
| 1767 | goto out_free_fasync; | 1767 | fl = NULL; |
| 1768 | } | ||
| 1769 | if (ret != fl) | ||
| 1770 | locks_free_lock(fl); | ||
| 1771 | 1768 | ||
| 1772 | /* | 1769 | /* |
| 1773 | * fasync_insert_entry() returns the old entry if any. | 1770 | * fasync_insert_entry() returns the old entry if any. |
| @@ -1779,9 +1776,10 @@ static int do_fcntl_add_lease(unsigned int fd, struct file *filp, long arg) | |||
| 1779 | new = NULL; | 1776 | new = NULL; |
| 1780 | 1777 | ||
| 1781 | error = __f_setown(filp, task_pid(current), PIDTYPE_PID, 0); | 1778 | error = __f_setown(filp, task_pid(current), PIDTYPE_PID, 0); |
| 1779 | out_unlock: | ||
| 1782 | spin_unlock(&inode->i_lock); | 1780 | spin_unlock(&inode->i_lock); |
| 1783 | 1781 | if (fl) | |
| 1784 | out_free_fasync: | 1782 | locks_free_lock(fl); |
| 1785 | if (new) | 1783 | if (new) |
| 1786 | fasync_free(new); | 1784 | fasync_free(new); |
| 1787 | return error; | 1785 | return error; |
