diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-03-21 14:58:20 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-03-21 14:58:20 -0700 |
commit | e0c0ca3546adf6aaa9ba7c7232bd3b1792f3153b (patch) | |
tree | 9e52be62727bdab332d02431856fc298859cbdc8 /net/tls/tls_main.c | |
parent | 351bdbb6419ca988802882badadc321d384d0254 (diff) | |
parent | b1a6f56b6506c2cecef301b5c3804be656a8c334 (diff) |
Merge branch 'net-tls-some-optimizations-for-tls'
Ziyang Xuan says:
====================
net/tls: some optimizations for tls
Do some small optimizations for tls, including jump instructions
optimization, and judgement processes optimization.
====================
Link: https://lore.kernel.org/r/cover.1647658604.git.william.xuanziyang@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/tls/tls_main.c')
-rw-r--r-- | net/tls/tls_main.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index 6bc2879ba637b..7b2b0e7ffee4c 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c @@ -553,10 +553,8 @@ static int do_tls_setsockopt_conf(struct sock *sk, sockptr_t optval, int rc = 0; int conf; - if (sockptr_is_null(optval) || (optlen < sizeof(*crypto_info))) { - rc = -EINVAL; - goto out; - } + if (sockptr_is_null(optval) || (optlen < sizeof(*crypto_info))) + return -EINVAL; if (tx) { crypto_info = &ctx->crypto_send.info; @@ -567,10 +565,8 @@ static int do_tls_setsockopt_conf(struct sock *sk, sockptr_t optval, } /* Currently we don't support set crypto info more than one time */ - if (TLS_CRYPTO_INFO_READY(crypto_info)) { - rc = -EBUSY; - goto out; - } + if (TLS_CRYPTO_INFO_READY(crypto_info)) + return -EBUSY; rc = copy_from_sockptr(crypto_info, optval, sizeof(*crypto_info)); if (rc) { @@ -672,11 +668,10 @@ static int do_tls_setsockopt_conf(struct sock *sk, sockptr_t optval, ctx->sk_write_space = sk->sk_write_space; sk->sk_write_space = tls_write_space; } - goto out; + return 0; err_crypto_info: memzero_explicit(crypto_info, sizeof(union tls_crypto_context)); -out: return rc; } |