Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134742
b: refs/heads/master
c: 2a517ca
h: refs/heads/master
v: v3
  • Loading branch information
Marcel Holtmann committed Feb 27, 2009
1 parent 31da9f4 commit c5dc28a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8bf4794174659b06d43cc5e290cd384757374613
refs/heads/master: 2a517ca687232adc8f14893730644da712010ffc
16 changes: 10 additions & 6 deletions trunk/net/bluetooth/l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,9 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
len = min_t(unsigned int, sizeof(la), alen);
memcpy(&la, addr, len);

if (la.l2_cid)
return -EINVAL;

lock_sock(sk);

if (sk->sk_state != BT_OPEN) {
Expand Down Expand Up @@ -929,19 +932,20 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int al
struct sockaddr_l2 la;
int len, err = 0;

lock_sock(sk);

BT_DBG("sk %p", sk);

if (!addr || addr->sa_family != AF_BLUETOOTH) {
err = -EINVAL;
goto done;
}
if (!addr || addr->sa_family != AF_BLUETOOTH)
return -EINVAL;

memset(&la, 0, sizeof(la));
len = min_t(unsigned int, sizeof(la), alen);
memcpy(&la, addr, len);

if (la.l2_cid)
return -EINVAL;

lock_sock(sk);

if (sk->sk_type == SOCK_SEQPACKET && !la.l2_psm) {
err = -EINVAL;
goto done;
Expand Down

0 comments on commit c5dc28a

Please sign in to comment.