Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tls: don't override sk_write_space if tls_set_sw_offload fails.

If we fail to enable tls in the kernel we shouldn't override
the sk_write_space callback

Fixes: 3c4d7559159b ('tls: kernel TLS support')
Signed-off-by: Ilya Lesokhin <ilyal@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Ilya Lesokhin and committed by
David S. Miller
ee181e52 196c31b4

+2 -3
+2 -3
net/tls/tls_main.c
··· 401 401 goto out; 402 402 } 403 403 404 - ctx->sk_write_space = sk->sk_write_space; 405 - sk->sk_write_space = tls_write_space; 406 - 407 404 /* currently SW is default, we will have ethtool in future */ 408 405 rc = tls_set_sw_offload(sk, ctx); 409 406 tx_conf = TLS_SW_TX; ··· 409 412 410 413 ctx->tx_conf = tx_conf; 411 414 update_sk_prot(sk, ctx); 415 + ctx->sk_write_space = sk->sk_write_space; 416 + sk->sk_write_space = tls_write_space; 412 417 goto out; 413 418 414 419 err_crypto_info: