diff options
Diffstat (limited to 'net/unix')
-rw-r--r-- | net/unix/af_unix.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 4450d6226602..8e1b10274b02 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -1459,9 +1459,6 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
1459 | struct scm_cookie tmp_scm; | 1459 | struct scm_cookie tmp_scm; |
1460 | int max_level; | 1460 | int max_level; |
1461 | int data_len = 0; | 1461 | int data_len = 0; |
1462 | struct iov_iter from; | ||
1463 | |||
1464 | iov_iter_init(&from, WRITE, msg->msg_iov, msg->msg_iovlen, len); | ||
1465 | 1462 | ||
1466 | if (NULL == siocb->scm) | 1463 | if (NULL == siocb->scm) |
1467 | siocb->scm = &tmp_scm; | 1464 | siocb->scm = &tmp_scm; |
@@ -1519,7 +1516,7 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
1519 | skb_put(skb, len - data_len); | 1516 | skb_put(skb, len - data_len); |
1520 | skb->data_len = data_len; | 1517 | skb->data_len = data_len; |
1521 | skb->len = len; | 1518 | skb->len = len; |
1522 | err = skb_copy_datagram_from_iter(skb, 0, &from, len); | 1519 | err = skb_copy_datagram_from_iter(skb, 0, &msg->msg_iter, len); |
1523 | if (err) | 1520 | if (err) |
1524 | goto out_free; | 1521 | goto out_free; |
1525 | 1522 | ||
@@ -1641,9 +1638,6 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
1641 | bool fds_sent = false; | 1638 | bool fds_sent = false; |
1642 | int max_level; | 1639 | int max_level; |
1643 | int data_len; | 1640 | int data_len; |
1644 | struct iov_iter from; | ||
1645 | |||
1646 | iov_iter_init(&from, WRITE, msg->msg_iov, msg->msg_iovlen, len); | ||
1647 | 1641 | ||
1648 | if (NULL == siocb->scm) | 1642 | if (NULL == siocb->scm) |
1649 | siocb->scm = &tmp_scm; | 1643 | siocb->scm = &tmp_scm; |
@@ -1700,7 +1694,7 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
1700 | skb_put(skb, size - data_len); | 1694 | skb_put(skb, size - data_len); |
1701 | skb->data_len = data_len; | 1695 | skb->data_len = data_len; |
1702 | skb->len = size; | 1696 | skb->len = size; |
1703 | err = skb_copy_datagram_from_iter(skb, 0, &from, size); | 1697 | err = skb_copy_datagram_from_iter(skb, 0, &msg->msg_iter, size); |
1704 | if (err) { | 1698 | if (err) { |
1705 | kfree_skb(skb); | 1699 | kfree_skb(skb); |
1706 | goto out_err; | 1700 | goto out_err; |