diff options
| author | Ilya Lesokhin <ilyal@mellanox.com> | 2017-11-13 03:22:49 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-11-14 02:26:35 -0500 |
| commit | ee181e5201e640a4b92b217e9eab2531dab57d2c (patch) | |
| tree | d0d4e6feae47f3b33d9f2672ba4828a63364ea6e /net/tls/tls_main.c | |
| parent | 196c31b4b54474b31dee3c30352c45c2a93e9226 (diff) | |
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>
Diffstat (limited to 'net/tls/tls_main.c')
| -rw-r--r-- | net/tls/tls_main.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index ab1bd167b63b..e07ee3ae0023 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c | |||
| @@ -401,9 +401,6 @@ static int do_tls_setsockopt_tx(struct sock *sk, char __user *optval, | |||
| 401 | goto out; | 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 | /* currently SW is default, we will have ethtool in future */ | 404 | /* currently SW is default, we will have ethtool in future */ |
| 408 | rc = tls_set_sw_offload(sk, ctx); | 405 | rc = tls_set_sw_offload(sk, ctx); |
| 409 | tx_conf = TLS_SW_TX; | 406 | tx_conf = TLS_SW_TX; |
| @@ -412,6 +409,8 @@ static int do_tls_setsockopt_tx(struct sock *sk, char __user *optval, | |||
| 412 | 409 | ||
| 413 | ctx->tx_conf = tx_conf; | 410 | ctx->tx_conf = tx_conf; |
| 414 | update_sk_prot(sk, ctx); | 411 | update_sk_prot(sk, ctx); |
| 412 | ctx->sk_write_space = sk->sk_write_space; | ||
| 413 | sk->sk_write_space = tls_write_space; | ||
| 415 | goto out; | 414 | goto out; |
| 416 | 415 | ||
| 417 | err_crypto_info: | 416 | err_crypto_info: |
