aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2010-09-24 19:30:57 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2010-10-12 11:44:52 -0400
commit0175d629e096a5a59dde6cc91b32ac3160a44b9e (patch)
tree32bcc77b1c99d42338064b4d5d5aa6ffae6c0759 /net/bluetooth
parentd6b2eb2f893547d7488d31a7088d78dd77ab5995 (diff)
Bluetooth: Use the proper error value from bt_skb_send_alloc()
&err points to the proper error set by bt_skb_send_alloc() when it fails. Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/l2cap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 7da6432f6799..01c476239dd6 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -1652,7 +1652,7 @@ static inline int l2cap_skbuff_fromiovec(struct sock *sk, struct msghdr *msg, in
1652 1652
1653 *frag = bt_skb_send_alloc(sk, count, msg->msg_flags & MSG_DONTWAIT, &err); 1653 *frag = bt_skb_send_alloc(sk, count, msg->msg_flags & MSG_DONTWAIT, &err);
1654 if (!*frag) 1654 if (!*frag)
1655 return -EFAULT; 1655 return err;
1656 if (memcpy_fromiovec(skb_put(*frag, count), msg->msg_iov, count)) 1656 if (memcpy_fromiovec(skb_put(*frag, count), msg->msg_iov, count))
1657 return -EFAULT; 1657 return -EFAULT;
1658 1658
@@ -1678,7 +1678,7 @@ static struct sk_buff *l2cap_create_connless_pdu(struct sock *sk, struct msghdr
1678 skb = bt_skb_send_alloc(sk, count + hlen, 1678 skb = bt_skb_send_alloc(sk, count + hlen,
1679 msg->msg_flags & MSG_DONTWAIT, &err); 1679 msg->msg_flags & MSG_DONTWAIT, &err);
1680 if (!skb) 1680 if (!skb)
1681 return ERR_PTR(-ENOMEM); 1681 return ERR_PTR(err);
1682 1682
1683 /* Create L2CAP header */ 1683 /* Create L2CAP header */
1684 lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE); 1684 lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE);
@@ -1707,7 +1707,7 @@ static struct sk_buff *l2cap_create_basic_pdu(struct sock *sk, struct msghdr *ms
1707 skb = bt_skb_send_alloc(sk, count + hlen, 1707 skb = bt_skb_send_alloc(sk, count + hlen,
1708 msg->msg_flags & MSG_DONTWAIT, &err); 1708 msg->msg_flags & MSG_DONTWAIT, &err);
1709 if (!skb) 1709 if (!skb)
1710 return ERR_PTR(-ENOMEM); 1710 return ERR_PTR(err);
1711 1711
1712 /* Create L2CAP header */ 1712 /* Create L2CAP header */
1713 lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE); 1713 lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE);
@@ -1744,7 +1744,7 @@ static struct sk_buff *l2cap_create_iframe_pdu(struct sock *sk, struct msghdr *m
1744 skb = bt_skb_send_alloc(sk, count + hlen, 1744 skb = bt_skb_send_alloc(sk, count + hlen,
1745 msg->msg_flags & MSG_DONTWAIT, &err); 1745 msg->msg_flags & MSG_DONTWAIT, &err);
1746 if (!skb) 1746 if (!skb)
1747 return ERR_PTR(-ENOMEM); 1747 return ERR_PTR(err);
1748 1748
1749 /* Create L2CAP header */ 1749 /* Create L2CAP header */
1750 lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE); 1750 lh = (struct l2cap_hdr *) skb_put(skb, L2CAP_HDR_SIZE);