summaryrefslogtreecommitdiffstats
path: root/net/tls
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2018-05-17 16:29:19 +0200
committerWolfram Sang <wsa@the-dreams.de>2018-05-17 16:29:19 +0200
commit3d8b7a4ea310f3621a19d50cbe6cbc89bb23b82f (patch)
tree51a261418928d8499ecade36f74e74fc92396503 /net/tls
parentc599eb4ff6e0f9c525695faab7149d8d48743b1c (diff)
parentcaaccda136ae3fa1c5f6563aae22ca3c199f563a (diff)
downloadlinux-3d8b7a4ea310f3621a19d50cbe6cbc89bb23b82f.tar.bz2
Merge branch 'i2c/platform_data-immutable' into i2c/for-4.18
Diffstat (limited to 'net/tls')
-rw-r--r--net/tls/tls_main.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
index cc03e00785c7..20cd93be6236 100644
--- a/net/tls/tls_main.c
+++ b/net/tls/tls_main.c
@@ -135,6 +135,7 @@ retry:
offset -= sg->offset;
ctx->partially_sent_offset = offset;
ctx->partially_sent_record = (void *)sg;
+ ctx->in_tcp_sendpages = false;
return ret;
}
@@ -248,16 +249,13 @@ static void tls_sk_proto_close(struct sock *sk, long timeout)
struct tls_context *ctx = tls_get_ctx(sk);
long timeo = sock_sndtimeo(sk, 0);
void (*sk_proto_close)(struct sock *sk, long timeout);
+ bool free_ctx = false;
lock_sock(sk);
sk_proto_close = ctx->sk_proto_close;
- if (ctx->conf == TLS_HW_RECORD)
- goto skip_tx_cleanup;
-
- if (ctx->conf == TLS_BASE) {
- kfree(ctx);
- ctx = NULL;
+ if (ctx->conf == TLS_BASE || ctx->conf == TLS_HW_RECORD) {
+ free_ctx = true;
goto skip_tx_cleanup;
}
@@ -294,7 +292,7 @@ skip_tx_cleanup:
/* free ctx for TLS_HW_RECORD, used by tcp_set_state
* for sk->sk_prot->unhash [tls_hw_unhash]
*/
- if (ctx && ctx->conf == TLS_HW_RECORD)
+ if (free_ctx)
kfree(ctx);
}