]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Bluetooth: ISO: unlock on error path in iso_sock_setsockopt()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 27 Jul 2022 12:08:56 +0000 (15:08 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 9 Aug 2022 00:03:57 +0000 (17:03 -0700)
Call release_sock(sk); before returning on this error path.

Fixes: e8b1014d0e46d ("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>
net/bluetooth/iso.c

index ff09c353e64ecd8df7d24626c58edb5749cbe53d..19d003727b5018d6f0eba4190b34ca41405bfdbb 100644 (file)
@@ -1177,8 +1177,10 @@ static int iso_sock_setsockopt(struct socket *sock, int level, int optname,
                }
 
                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));