summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/iso.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-07-27 14:08:56 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-08-09 02:03:57 +0200
commit164dac9755ac297b0c07505ad3db9e7d69b80499 (patch)
tree22cf230bbdb68c089bec3740e0a3a6c45489557b /net/bluetooth/iso.c
parentBluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression (diff)
downloadlinux-164dac9755ac297b0c07505ad3db9e7d69b80499.tar.xz
linux-164dac9755ac297b0c07505ad3db9e7d69b80499.zip
Bluetooth: ISO: unlock on error path in iso_sock_setsockopt()
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>
Diffstat (limited to 'net/bluetooth/iso.c')
-rw-r--r--net/bluetooth/iso.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index ff09c353e64e..19d003727b50 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -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));