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
This commit is contained in:
parent
573bd1fcf5
commit
d01db2b837
@ -744,7 +744,7 @@ ktls_create_session(struct socket *so, struct tls_enable *en,
|
||||
return (0);
|
||||
|
||||
out:
|
||||
ktls_cleanup(tls);
|
||||
ktls_free(tls);
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -1309,7 +1309,7 @@ ktls_enable_rx(struct socket *so, struct tls_enable *en)
|
||||
|
||||
error = ktls_ocf_try(so, tls, KTLS_RX);
|
||||
if (error) {
|
||||
ktls_cleanup(tls);
|
||||
ktls_free(tls);
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -1387,13 +1387,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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user