linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3] Bluetooth: Split error handling for SCO listen sockets
@ 2012-04-19 11:43 Marcel Holtmann
  2012-04-19 14:39 ` Gustavo Padovan
  0 siblings, 1 reply; 2+ messages in thread
From: Marcel Holtmann @ 2012-04-19 11:43 UTC (permalink / raw)
  To: linux-bluetooth

Split the checks for sk->sk_state and sk->sk_type for SCO listen
sockets. This makes the code more readable.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
 net/bluetooth/sco.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 32c0e31..2fb9636 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -540,11 +540,16 @@ static int sco_sock_listen(struct socket *sock, int backlog)
 
 	lock_sock(sk);
 
-	if (sk->sk_state != BT_BOUND || sock->type != SOCK_SEQPACKET) {
+	if (sk->sk_state != BT_BOUND) {
 		err = -EBADFD;
 		goto done;
 	}
 
+	if (sk->sk_type != SOCK_SEQPACKET) {
+		err = -EINVAL;
+		goto done;
+	}
+
 	sk->sk_max_ack_backlog = backlog;
 	sk->sk_ack_backlog = 0;
 	sk->sk_state = BT_LISTEN;
-- 
1.7.7.6


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

* Re: [PATCH 2/3] Bluetooth: Split error handling for SCO listen sockets
  2012-04-19 11:43 [PATCH 2/3] Bluetooth: Split error handling for SCO listen sockets Marcel Holtmann
@ 2012-04-19 14:39 ` Gustavo Padovan
  0 siblings, 0 replies; 2+ messages in thread
From: Gustavo Padovan @ 2012-04-19 14:39 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

* Marcel Holtmann <marcel@holtmann.org> [2012-04-19 13:43:52 +0200]:

> Split the checks for sk->sk_state and sk->sk_type for SCO listen
> sockets. This makes the code more readable.
> 
> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> ---
>  net/bluetooth/sco.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)

Applied to bluetooth-next, thanks.

	Gustavo

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

end of thread, other threads:[~2012-04-19 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-19 11:43 [PATCH 2/3] Bluetooth: Split error handling for SCO listen sockets Marcel Holtmann
2012-04-19 14:39 ` Gustavo Padovan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).