All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: ISO: unlock on error path in iso_sock_setsockopt()
@ 2022-07-27 12:08 Dan Carpenter
  2022-07-27 12:10 ` [PATCH 2/2] Bluetooth: ISO: fix info leak in iso_sock_getsockopt() Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dan Carpenter @ 2022-07-27 12:08 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz
  Cc: Johan Hedberg, linux-bluetooth, kernel-janitors

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

Fixes: ccf74f2390d6 ("Bluetooth: Add BTPROTO_ISO socket type")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 net/bluetooth/iso.c | 6 ++++--
 1 file 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));
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-07-28  6:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-27 12:08 [PATCH 1/2] Bluetooth: ISO: unlock on error path in iso_sock_setsockopt() Dan Carpenter
2022-07-27 12:10 ` [PATCH 2/2] Bluetooth: ISO: fix info leak in iso_sock_getsockopt() Dan Carpenter
2022-07-27 19:51   ` Luiz Augusto von Dentz
2022-07-28  6:40     ` Dan Carpenter
2022-07-27 13:37 ` [1/2] Bluetooth: ISO: unlock on error path in iso_sock_setsockopt() bluez.test.bot
2022-07-27 20:00 ` [PATCH 1/2] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.