]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/tls: fix build without CONFIG_TLS_DEVICE
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 10 Apr 2019 23:23:39 +0000 (16:23 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Apr 2019 00:23:26 +0000 (17:23 -0700)
buildbot noticed that TLS_HW is not defined if CONFIG_TLS_DEVICE=n.
Wrap the cleanup branch into an ifdef, tls_device_free_resources_tx()
wouldn't be compiled either in this case.

Fixes: 7a905c692e14 ("net/tls: don't leak partially sent record in device mode")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_main.c

index a3cca1ef009853aed7af9ddb6e45b3c11039f04b..9547cea0ce3b078b4ca79fec7b24232b046b74c6 100644 (file)
@@ -287,8 +287,10 @@ static void tls_sk_proto_close(struct sock *sk, long timeout)
                kfree(ctx->tx.rec_seq);
                kfree(ctx->tx.iv);
                tls_sw_free_resources_tx(sk);
+#ifdef CONFIG_TLS_DEVICE
        } else if (ctx->tx_conf == TLS_HW) {
                tls_device_free_resources_tx(sk);
+#endif
        }
 
        if (ctx->rx_conf == TLS_SW) {