diff options
author | Gustavo Padovan <gustavo@padovan.org> | 2012-04-06 19:15:47 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo@padovan.org> | 2012-05-09 00:40:26 -0400 |
commit | 9033894722ec595053c92bfa4359b37e7bc91b78 (patch) | |
tree | 33707a9d67a8d024ebe78551ec8d1bded53666b8 /net/bluetooth/l2cap_core.c | |
parent | bd4b165312bacbf1e732cbc22c141362cfb5fda3 (diff) |
Bluetooth: Remove err parameter from alloc_skb()
Use ERR_PTR maginc instead.
Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 2eac6184a231..03746f565fc4 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -1563,7 +1563,7 @@ static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan, | |||
1563 | { | 1563 | { |
1564 | struct l2cap_conn *conn = chan->conn; | 1564 | struct l2cap_conn *conn = chan->conn; |
1565 | struct sk_buff **frag; | 1565 | struct sk_buff **frag; |
1566 | int err, sent = 0; | 1566 | int sent = 0; |
1567 | 1567 | ||
1568 | if (memcpy_fromiovec(skb_put(skb, count), msg->msg_iov, count)) | 1568 | if (memcpy_fromiovec(skb_put(skb, count), msg->msg_iov, count)) |
1569 | return -EFAULT; | 1569 | return -EFAULT; |
@@ -1577,11 +1577,10 @@ static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan, | |||
1577 | count = min_t(unsigned int, conn->mtu, len); | 1577 | count = min_t(unsigned int, conn->mtu, len); |
1578 | 1578 | ||
1579 | *frag = chan->ops->alloc_skb(chan, count, | 1579 | *frag = chan->ops->alloc_skb(chan, count, |
1580 | msg->msg_flags & MSG_DONTWAIT, | 1580 | msg->msg_flags & MSG_DONTWAIT); |
1581 | &err); | ||
1582 | 1581 | ||
1583 | if (!*frag) | 1582 | if (IS_ERR(*frag)) |
1584 | return err; | 1583 | return PTR_ERR(*frag); |
1585 | if (memcpy_fromiovec(skb_put(*frag, count), msg->msg_iov, count)) | 1584 | if (memcpy_fromiovec(skb_put(*frag, count), msg->msg_iov, count)) |
1586 | return -EFAULT; | 1585 | return -EFAULT; |
1587 | 1586 | ||
@@ -1610,10 +1609,9 @@ static struct sk_buff *l2cap_create_connless_pdu(struct l2cap_chan *chan, | |||
1610 | count = min_t(unsigned int, (conn->mtu - hlen), len); | 1609 | count = min_t(unsigned int, (conn->mtu - hlen), len); |
1611 | 1610 | ||
1612 | skb = chan->ops->alloc_skb(chan, count + hlen, | 1611 | skb = chan->ops->alloc_skb(chan, count + hlen, |
1613 | msg->msg_flags & MSG_DONTWAIT, &err); | 1612 | msg->msg_flags & MSG_DONTWAIT); |
1614 | 1613 | if (IS_ERR(skb)) | |
1615 | if (!skb) | 1614 | return skb; |
1616 | return ERR_PTR(err); | ||
1617 | 1615 | ||
1618 | skb->priority = priority; | 1616 | skb->priority = priority; |
1619 | 1617 | ||
@@ -1645,10 +1643,9 @@ static struct sk_buff *l2cap_create_basic_pdu(struct l2cap_chan *chan, | |||
1645 | count = min_t(unsigned int, (conn->mtu - hlen), len); | 1643 | count = min_t(unsigned int, (conn->mtu - hlen), len); |
1646 | 1644 | ||
1647 | skb = chan->ops->alloc_skb(chan, count + hlen, | 1645 | skb = chan->ops->alloc_skb(chan, count + hlen, |
1648 | msg->msg_flags & MSG_DONTWAIT, &err); | 1646 | msg->msg_flags & MSG_DONTWAIT); |
1649 | 1647 | if (IS_ERR(skb)) | |
1650 | if (!skb) | 1648 | return skb; |
1651 | return ERR_PTR(err); | ||
1652 | 1649 | ||
1653 | skb->priority = priority; | 1650 | skb->priority = priority; |
1654 | 1651 | ||
@@ -1693,10 +1690,9 @@ static struct sk_buff *l2cap_create_iframe_pdu(struct l2cap_chan *chan, | |||
1693 | count = min_t(unsigned int, (conn->mtu - hlen), len); | 1690 | count = min_t(unsigned int, (conn->mtu - hlen), len); |
1694 | 1691 | ||
1695 | skb = chan->ops->alloc_skb(chan, count + hlen, | 1692 | skb = chan->ops->alloc_skb(chan, count + hlen, |
1696 | msg->msg_flags & MSG_DONTWAIT, &err); | 1693 | msg->msg_flags & MSG_DONTWAIT); |
1697 | 1694 | if (IS_ERR(skb)) | |
1698 | if (!skb) | 1695 | return skb; |
1699 | return ERR_PTR(err); | ||
1700 | 1696 | ||
1701 | /* Create L2CAP header */ | 1697 | /* Create L2CAP header */ |
1702 | lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE); | 1698 | lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE); |