diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index 08ddf9d837ae..4625d8415fb2 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c @@ -305,6 +305,7 @@ static void tls_sk_proto_close(struct sock *sk, long timeout) long timeo = sock_sndtimeo(sk, 0); bool free_ctx; + ctx->sk_proto->close(sk, timeout); if (ctx->tx_conf == TLS_SW) tls_sw_cancel_work_tx(ctx); @@ -328,7 +329,6 @@ static void tls_sk_proto_close(struct sock *sk, long timeout) tls_sw_strparser_done(ctx); if (ctx->rx_conf == TLS_SW) tls_sw_free_ctx_rx(ctx); - ctx->sk_proto->close(sk, timeout); if (free_ctx) tls_ctx_free(sk, ctx);