mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
tls: rx: drop unnecessary arguments from tls_setup_from_iter()
[ Upstream commit d4bd88e676 ]
sk is unused, remove it to make it clear the function
doesn't poke at the socket.
size_used is always 0 on input and @length on success.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: f7fa16d49837 ("tls: decrement decrypt_pending if no async completion will be called")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1abd49fa1f
commit
ffc8a2b821
@@ -1348,15 +1348,14 @@ static struct sk_buff *tls_wait_data(struct sock *sk, struct sk_psock *psock,
|
|||||||
return skb;
|
return skb;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tls_setup_from_iter(struct sock *sk, struct iov_iter *from,
|
static int tls_setup_from_iter(struct iov_iter *from,
|
||||||
int length, int *pages_used,
|
int length, int *pages_used,
|
||||||
unsigned int *size_used,
|
|
||||||
struct scatterlist *to,
|
struct scatterlist *to,
|
||||||
int to_max_pages)
|
int to_max_pages)
|
||||||
{
|
{
|
||||||
int rc = 0, i = 0, num_elem = *pages_used, maxpages;
|
int rc = 0, i = 0, num_elem = *pages_used, maxpages;
|
||||||
struct page *pages[MAX_SKB_FRAGS];
|
struct page *pages[MAX_SKB_FRAGS];
|
||||||
unsigned int size = *size_used;
|
unsigned int size = 0;
|
||||||
ssize_t copied, use;
|
ssize_t copied, use;
|
||||||
size_t offset;
|
size_t offset;
|
||||||
|
|
||||||
@@ -1399,8 +1398,7 @@ static int tls_setup_from_iter(struct sock *sk, struct iov_iter *from,
|
|||||||
sg_mark_end(&to[num_elem - 1]);
|
sg_mark_end(&to[num_elem - 1]);
|
||||||
out:
|
out:
|
||||||
if (rc)
|
if (rc)
|
||||||
iov_iter_revert(from, size - *size_used);
|
iov_iter_revert(from, size);
|
||||||
*size_used = size;
|
|
||||||
*pages_used = num_elem;
|
*pages_used = num_elem;
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
@@ -1519,12 +1517,12 @@ static int decrypt_internal(struct sock *sk, struct sk_buff *skb,
|
|||||||
sg_init_table(sgout, n_sgout);
|
sg_init_table(sgout, n_sgout);
|
||||||
sg_set_buf(&sgout[0], aad, prot->aad_size);
|
sg_set_buf(&sgout[0], aad, prot->aad_size);
|
||||||
|
|
||||||
*chunk = 0;
|
err = tls_setup_from_iter(out_iov, data_len,
|
||||||
err = tls_setup_from_iter(sk, out_iov, data_len,
|
&pages, &sgout[1],
|
||||||
&pages, chunk, &sgout[1],
|
|
||||||
(n_sgout - 1));
|
(n_sgout - 1));
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto fallback_to_reg_recv;
|
goto fallback_to_reg_recv;
|
||||||
|
*chunk = data_len;
|
||||||
} else if (out_sg) {
|
} else if (out_sg) {
|
||||||
memcpy(sgout, out_sg, n_sgout * sizeof(*sgout));
|
memcpy(sgout, out_sg, n_sgout * sizeof(*sgout));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user