]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.0/net-tls-fix-build-without-config_tls_device.patch
5.0-stable patches
[thirdparty/kernel/stable-queue.git] / queue-5.0 / net-tls-fix-build-without-config_tls_device.patch
1 From foo@baz Sat Apr 20 16:43:09 CEST 2019
2 From: Jakub Kicinski <jakub.kicinski@netronome.com>
3 Date: Wed, 10 Apr 2019 16:23:39 -0700
4 Subject: net/tls: fix build without CONFIG_TLS_DEVICE
5
6 From: Jakub Kicinski <jakub.kicinski@netronome.com>
7
8 [ Upstream commit 903f1a187776bb8d79b13618ec05b25f86318885 ]
9
10 buildbot noticed that TLS_HW is not defined if CONFIG_TLS_DEVICE=n.
11 Wrap the cleanup branch into an ifdef, tls_device_free_resources_tx()
12 wouldn't be compiled either in this case.
13
14 Fixes: 35b71a34ada6 ("net/tls: don't leak partially sent record in device mode")
15 Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
16 Signed-off-by: David S. Miller <davem@davemloft.net>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18 ---
19 net/tls/tls_main.c | 2 ++
20 1 file changed, 2 insertions(+)
21
22 --- a/net/tls/tls_main.c
23 +++ b/net/tls/tls_main.c
24 @@ -298,8 +298,10 @@ static void tls_sk_proto_close(struct so
25 kfree(ctx->tx.rec_seq);
26 kfree(ctx->tx.iv);
27 tls_sw_free_resources_tx(sk);
28 +#ifdef CONFIG_TLS_DEVICE
29 } else if (ctx->tx_conf == TLS_HW) {
30 tls_device_free_resources_tx(sk);
31 +#endif
32 }
33
34 if (ctx->rx_conf == TLS_SW) {