Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306876
b: refs/heads/master
c: 9033894
h: refs/heads/master
v: v3
  • Loading branch information
Gustavo Padovan committed May 9, 2012
1 parent 5eed0e1 commit 3d1c786
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 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: bd4b165312bacbf1e732cbc22c141362cfb5fda3
refs/heads/master: 9033894722ec595053c92bfa4359b37e7bc91b78
2 changes: 1 addition & 1 deletion trunk/include/net/bluetooth/l2cap.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ struct l2cap_ops {
void (*close) (void *data);
void (*state_change) (void *data, int state);
struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,
unsigned long len, int nb, int *err);
unsigned long len, int nb);

};

Expand Down
30 changes: 13 additions & 17 deletions trunk/net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan,
{
struct l2cap_conn *conn = chan->conn;
struct sk_buff **frag;
int err, sent = 0;
int sent = 0;

if (memcpy_fromiovec(skb_put(skb, count), msg->msg_iov, count))
return -EFAULT;
Expand All @@ -1577,11 +1577,10 @@ static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan,
count = min_t(unsigned int, conn->mtu, len);

*frag = chan->ops->alloc_skb(chan, count,
msg->msg_flags & MSG_DONTWAIT,
&err);
msg->msg_flags & MSG_DONTWAIT);

if (!*frag)
return err;
if (IS_ERR(*frag))
return PTR_ERR(*frag);
if (memcpy_fromiovec(skb_put(*frag, count), msg->msg_iov, count))
return -EFAULT;

Expand Down Expand Up @@ -1610,10 +1609,9 @@ static struct sk_buff *l2cap_create_connless_pdu(struct l2cap_chan *chan,
count = min_t(unsigned int, (conn->mtu - hlen), len);

skb = chan->ops->alloc_skb(chan, count + hlen,
msg->msg_flags & MSG_DONTWAIT, &err);

if (!skb)
return ERR_PTR(err);
msg->msg_flags & MSG_DONTWAIT);
if (IS_ERR(skb))
return skb;

skb->priority = priority;

Expand Down Expand Up @@ -1645,10 +1643,9 @@ static struct sk_buff *l2cap_create_basic_pdu(struct l2cap_chan *chan,
count = min_t(unsigned int, (conn->mtu - hlen), len);

skb = chan->ops->alloc_skb(chan, count + hlen,
msg->msg_flags & MSG_DONTWAIT, &err);

if (!skb)
return ERR_PTR(err);
msg->msg_flags & MSG_DONTWAIT);
if (IS_ERR(skb))
return skb;

skb->priority = priority;

Expand Down Expand Up @@ -1693,10 +1690,9 @@ static struct sk_buff *l2cap_create_iframe_pdu(struct l2cap_chan *chan,
count = min_t(unsigned int, (conn->mtu - hlen), len);

skb = chan->ops->alloc_skb(chan, count + hlen,
msg->msg_flags & MSG_DONTWAIT, &err);

if (!skb)
return ERR_PTR(err);
msg->msg_flags & MSG_DONTWAIT);
if (IS_ERR(skb))
return skb;

/* Create L2CAP header */
lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE);
Expand Down
12 changes: 8 additions & 4 deletions trunk/net/bluetooth/l2cap_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -927,12 +927,16 @@ static void l2cap_sock_state_change_cb(void *data, int state)
}

static struct sk_buff *l2cap_sock_alloc_skb_cb(struct l2cap_chan *chan,
unsigned long len, int nb,
int *err)
unsigned long len, int nb)
{
struct sock *sk = chan->sk;
struct sk_buff *skb;
int err;

skb = bt_skb_send_alloc(chan->sk, len, nb, &err);
if (!skb)
return ERR_PTR(err);

return bt_skb_send_alloc(sk, len, nb, err);
return skb;
}

static struct l2cap_ops l2cap_chan_ops = {
Expand Down

0 comments on commit 3d1c786

Please sign in to comment.