net/tls: don't re-check msg decrypted status in tls_device_decrypted()
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 3 Jun 2019 22:17:02 +0000 (15:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Jun 2019 21:33:50 +0000 (14:33 -0700)
tls_device_decrypted() is only called from decrypt_skb_update(),
when ctx->decrypted == false, there is no need to re-check the bit.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_device.c

index dde6513628d216b2d506e51de9134a27c80dfb4f..bb9d229832cc21f5794b776ffac5c42c00ffc8d9 100644 (file)
@@ -672,10 +672,6 @@ int tls_device_decrypted(struct sock *sk, struct sk_buff *skb)
        int is_encrypted = !is_decrypted;
        struct sk_buff *skb_iter;
 
-       /* Skip if it is already decrypted */
-       if (ctx->sw.decrypted)
-               return 0;
-
        /* Check if all the data is decrypted already */
        skb_walk_frags(skb, skb_iter) {
                is_decrypted &= skb_iter->decrypted;