diff options
Diffstat (limited to 'net/bluetooth/sco.c')
-rw-r--r-- | 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 7bd0947af2fa..a69aa345597e 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -539,11 +539,16 @@ static int sco_sock_listen(struct socket *sock, int backlog) | |||
539 | 539 | ||
540 | lock_sock(sk); | 540 | lock_sock(sk); |
541 | 541 | ||
542 | if (sk->sk_state != BT_BOUND || sock->type != SOCK_SEQPACKET) { | 542 | if (sk->sk_state != BT_BOUND) { |
543 | err = -EBADFD; | 543 | err = -EBADFD; |
544 | goto done; | 544 | goto done; |
545 | } | 545 | } |
546 | 546 | ||
547 | if (sk->sk_type != SOCK_SEQPACKET) { | ||
548 | err = -EINVAL; | ||
549 | goto done; | ||
550 | } | ||
551 | |||
547 | sk->sk_max_ack_backlog = backlog; | 552 | sk->sk_max_ack_backlog = backlog; |
548 | sk->sk_ack_backlog = 0; | 553 | sk->sk_ack_backlog = 0; |
549 | sk->sk_state = BT_LISTEN; | 554 | sk->sk_state = BT_LISTEN; |