diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2023-10-09 22:50:51 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-10-13 12:26:10 +0200 |
commit | 4f4866991847738a216bb5920b3d3902cee13fd0 (patch) | |
tree | ae783d54754162563e981fcea5836fbe88222a09 /net/tls/tls_device.c | |
parent | tls: remove tls_context argument from tls_set_sw_offload (diff) | |
download | linux-4f4866991847738a216bb5920b3d3902cee13fd0.tar.xz linux-4f4866991847738a216bb5920b3d3902cee13fd0.zip |
tls: remove tls_context argument from tls_set_device_offload
It's not really needed since we end up refetching it as tls_ctx. We
can also remove the NULL check, since we have already dereferenced ctx
in do_tls_setsockopt_conf.
While at it, fix up the reverse xmas tree ordering.
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls/tls_device.c')
-rw-r--r-- | net/tls/tls_device.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index 1dc217870f9d..fe52765beaee 100644 --- a/net/tls/tls_device.c +++ b/net/tls/tls_device.c @@ -1057,21 +1057,21 @@ static struct tls_offload_context_tx *alloc_offload_ctx_tx(struct tls_context *c return offload_ctx; } -int tls_set_device_offload(struct sock *sk, struct tls_context *ctx) +int tls_set_device_offload(struct sock *sk) { - struct tls_context *tls_ctx = tls_get_ctx(sk); - struct tls_prot_info *prot = &tls_ctx->prot_info; - const struct tls_cipher_desc *cipher_desc; struct tls_record_info *start_marker_record; struct tls_offload_context_tx *offload_ctx; + const struct tls_cipher_desc *cipher_desc; struct tls_crypto_info *crypto_info; + struct tls_prot_info *prot; struct net_device *netdev; - char *iv, *rec_seq; + struct tls_context *ctx; struct sk_buff *skb; + char *iv, *rec_seq; int rc; - if (!ctx) - return -EINVAL; + ctx = tls_get_ctx(sk); + prot = &ctx->prot_info; if (ctx->priv_ctx_tx) return -EEXIST; |