[patch v2] locks: missing unlock on error in generic_add_lease()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We should unlock here before returning.

Fixes: df4e8d2c1d2b ('locks: implement delegations')
Acked-by: J. Bruce Fields <bfields@xxxxxxxxxx>
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
v2: Style fix

diff --git a/fs/locks.c b/fs/locks.c
index f99d52b..7b7ed7d 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1495,7 +1495,8 @@ static int generic_add_lease(struct file *filp, long arg, struct file_lock **flp
 	if (is_deleg && arg == F_WRLCK) {
 		/* Write delegations are not currently supported: */
 		WARN_ON_ONCE(1);
-		return -EINVAL;
+		error = -EINVAL;
+		goto out;
 	}
 
 	error = -EAGAIN;
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux