Skip to content

Commit 39f56e1

Browse files
Boris Pismennydavem330
authored andcommitted
tls: Split tls_sw_release_resources_rx
This patch splits tls_sw_release_resources_rx into two functions one which releases all inner software tls structures and another that also frees the containing structure. In TLS_DEVICE we will need to release the software structures without freeeing the containing structure, which contains other information. Signed-off-by: Boris Pismenny <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent dafb67f commit 39f56e1

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

include/net/tls.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ int tls_sw_sendpage(struct sock *sk, struct page *page,
223223
void tls_sw_close(struct sock *sk, long timeout);
224224
void tls_sw_free_resources_tx(struct sock *sk);
225225
void tls_sw_free_resources_rx(struct sock *sk);
226+
void tls_sw_release_resources_rx(struct sock *sk);
226227
int tls_sw_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
227228
int nonblock, int flags, int *addr_len);
228229
unsigned int tls_sw_poll(struct file *file, struct socket *sock,

net/tls/tls_sw.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ void tls_sw_free_resources_tx(struct sock *sk)
10301030
kfree(ctx);
10311031
}
10321032

1033-
void tls_sw_free_resources_rx(struct sock *sk)
1033+
void tls_sw_release_resources_rx(struct sock *sk)
10341034
{
10351035
struct tls_context *tls_ctx = tls_get_ctx(sk);
10361036
struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
@@ -1049,6 +1049,14 @@ void tls_sw_free_resources_rx(struct sock *sk)
10491049
strp_done(&ctx->strp);
10501050
lock_sock(sk);
10511051
}
1052+
}
1053+
1054+
void tls_sw_free_resources_rx(struct sock *sk)
1055+
{
1056+
struct tls_context *tls_ctx = tls_get_ctx(sk);
1057+
struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
1058+
1059+
tls_sw_release_resources_rx(sk);
10521060

10531061
kfree(ctx);
10541062
}

0 commit comments

Comments
 (0)