diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-11-27 12:16:44 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-11-28 22:40:29 -0800 |
commit | c5daa6cccdc2f94aca2c9b3fa5f94e4469997293 (patch) | |
tree | 3372cdfae43b0b90d47d89ecb170d87c8b472c2b /net/tls/tls_sw.c | |
parent | 9e5ffed37df68d0ccfb2fdc528609e23a1e70ebe (diff) | |
download | lwn-c5daa6cccdc2f94aca2c9b3fa5f94e4469997293.tar.gz lwn-c5daa6cccdc2f94aca2c9b3fa5f94e4469997293.zip |
net/tls: use sg_next() to walk sg entries
Partially sent record cleanup path increments an SG entry
directly instead of using sg_next(). This should not be a
problem today, as encrypted messages should be always
allocated as arrays. But given this is a cleanup path it's
easy to miss was this ever to change. Use sg_next(), and
simplify the code.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls/tls_sw.c')
-rw-r--r-- | net/tls/tls_sw.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index 5989dfe5c443..2b2d0bae14a9 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -2089,7 +2089,8 @@ void tls_sw_release_resources_tx(struct sock *sk) /* Free up un-sent records in tx_list. First, free * the partially sent record if any at head of tx_list. */ - if (tls_free_partial_record(sk, tls_ctx)) { + if (tls_ctx->partially_sent_record) { + tls_free_partial_record(sk, tls_ctx); rec = list_first_entry(&ctx->tx_list, struct tls_rec, list); list_del(&rec->list); |