git: 4f1a2168f685 - stable/13 - ktls: Don't leak ktls session objects for certain errors.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Jan 2023 05:43:12 UTC
The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4f1a2168f685cadd9e8720fc6220a7a686fba2d5 commit 4f1a2168f685cadd9e8720fc6220a7a686fba2d5 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2022-11-12 00:00:37 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2023-01-24 04:57:41 +0000 ktls: Don't leak ktls session objects for certain errors. ktls_cleanup() does not free ktls session objects, it merely cleans (and frees) members of the object. Change callers to use ktls_free() instead. Reviewed by: gallatin, markj Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D37352 (cherry picked from commit d01db2b83705eb3557a32ea13143997cdb8135a3) --- sys/kern/uipc_ktls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index f60d5e0948d0..e3f84171a976 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -682,7 +682,7 @@ ktls_create_session(struct socket *so, struct tls_enable *en, return (0); out: - ktls_cleanup(tls); + ktls_free(tls); return (error); } @@ -1099,7 +1099,7 @@ ktls_enable_rx(struct socket *so, struct tls_enable *en) error = ktls_try_sw(so, tls, KTLS_RX); if (error) { - ktls_cleanup(tls); + ktls_free(tls); return (error); } @@ -1170,13 +1170,13 @@ ktls_enable_tx(struct socket *so, struct tls_enable *en) error = ktls_try_sw(so, tls, KTLS_TX); if (error) { - ktls_cleanup(tls); + ktls_free(tls); return (error); } error = SOCK_IO_SEND_LOCK(so, SBL_WAIT); if (error) { - ktls_cleanup(tls); + ktls_free(tls); return (error); }