Blob Blame History Raw
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 27 Jul 2022 15:08:56 +0300
Subject: Bluetooth: ISO: unlock on error path in iso_sock_setsockopt()
Patch-mainline: v6.0-rc1
Git-commit: 164dac9755ac297b0c07505ad3db9e7d69b80499
References: jsc#PED-1407

Call release_sock(sk); before returning on this error path.

Fixes: ccf74f2390d60 ("Bluetooth: Add BTPROTO_ISO socket type")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Acked-by: Lee, Chun-Yi <jlee@suse.com>
---
 net/bluetooth/iso.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -1177,8 +1177,10 @@ static int iso_sock_setsockopt(struct so
 		}
 
 		len = min_t(unsigned int, sizeof(qos), optlen);
-		if (len != sizeof(qos))
-			return -EINVAL;
+		if (len != sizeof(qos)) {
+			err = -EINVAL;
+			break;
+		}
 
 		memset(&qos, 0, sizeof(qos));