diff options
Diffstat (limited to 'net/irda/af_irda.c')
-rw-r--r-- | net/irda/af_irda.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index c3cd2ba123e5..bf994c85e45a 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
@@ -1274,7 +1274,6 @@ static int irda_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1274 | struct sock *sk = sock->sk; | 1274 | struct sock *sk = sock->sk; |
1275 | struct irda_sock *self; | 1275 | struct irda_sock *self; |
1276 | struct sk_buff *skb; | 1276 | struct sk_buff *skb; |
1277 | unsigned char *asmptr; | ||
1278 | int err; | 1277 | int err; |
1279 | 1278 | ||
1280 | IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len); | 1279 | IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len); |
@@ -1317,9 +1316,9 @@ static int irda_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1317 | return -ENOBUFS; | 1316 | return -ENOBUFS; |
1318 | 1317 | ||
1319 | skb_reserve(skb, self->max_header_size + 16); | 1318 | skb_reserve(skb, self->max_header_size + 16); |
1320 | 1319 | skb_reset_transport_header(skb); | |
1321 | asmptr = skb->h.raw = skb_put(skb, len); | 1320 | skb_put(skb, len); |
1322 | err = memcpy_fromiovec(asmptr, msg->msg_iov, len); | 1321 | err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len); |
1323 | if (err) { | 1322 | if (err) { |
1324 | kfree_skb(skb); | 1323 | kfree_skb(skb); |
1325 | return err; | 1324 | return err; |
@@ -1530,7 +1529,6 @@ static int irda_sendmsg_dgram(struct kiocb *iocb, struct socket *sock, | |||
1530 | struct sock *sk = sock->sk; | 1529 | struct sock *sk = sock->sk; |
1531 | struct irda_sock *self; | 1530 | struct irda_sock *self; |
1532 | struct sk_buff *skb; | 1531 | struct sk_buff *skb; |
1533 | unsigned char *asmptr; | ||
1534 | int err; | 1532 | int err; |
1535 | 1533 | ||
1536 | IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len); | 1534 | IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len); |
@@ -1566,10 +1564,11 @@ static int irda_sendmsg_dgram(struct kiocb *iocb, struct socket *sock, | |||
1566 | return -ENOBUFS; | 1564 | return -ENOBUFS; |
1567 | 1565 | ||
1568 | skb_reserve(skb, self->max_header_size); | 1566 | skb_reserve(skb, self->max_header_size); |
1567 | skb_reset_transport_header(skb); | ||
1569 | 1568 | ||
1570 | IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__); | 1569 | IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__); |
1571 | asmptr = skb->h.raw = skb_put(skb, len); | 1570 | skb_put(skb, len); |
1572 | err = memcpy_fromiovec(asmptr, msg->msg_iov, len); | 1571 | err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len); |
1573 | if (err) { | 1572 | if (err) { |
1574 | kfree_skb(skb); | 1573 | kfree_skb(skb); |
1575 | return err; | 1574 | return err; |
@@ -1602,7 +1601,6 @@ static int irda_sendmsg_ultra(struct kiocb *iocb, struct socket *sock, | |||
1602 | __u8 pid = 0; | 1601 | __u8 pid = 0; |
1603 | int bound = 0; | 1602 | int bound = 0; |
1604 | struct sk_buff *skb; | 1603 | struct sk_buff *skb; |
1605 | unsigned char *asmptr; | ||
1606 | int err; | 1604 | int err; |
1607 | 1605 | ||
1608 | IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len); | 1606 | IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len); |
@@ -1662,10 +1660,11 @@ static int irda_sendmsg_ultra(struct kiocb *iocb, struct socket *sock, | |||
1662 | return -ENOBUFS; | 1660 | return -ENOBUFS; |
1663 | 1661 | ||
1664 | skb_reserve(skb, self->max_header_size); | 1662 | skb_reserve(skb, self->max_header_size); |
1663 | skb_reset_transport_header(skb); | ||
1665 | 1664 | ||
1666 | IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__); | 1665 | IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__); |
1667 | asmptr = skb->h.raw = skb_put(skb, len); | 1666 | skb_put(skb, len); |
1668 | err = memcpy_fromiovec(asmptr, msg->msg_iov, len); | 1667 | err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len); |
1669 | if (err) { | 1668 | if (err) { |
1670 | kfree_skb(skb); | 1669 | kfree_skb(skb); |
1671 | return err; | 1670 | return err; |