net/tls: remove redundant second null check on sgout
authorColin Ian King <colin.king@canonical.com>
Tue, 24 Apr 2018 12:36:58 +0000 (13:36 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Apr 2018 20:02:10 +0000 (16:02 -0400)
A duplicated null check on sgout is redundant as it is known to be
already true because of the identical earlier check. Remove it.
Detected by cppcheck:

net/tls/tls_sw.c:696: (warning) Identical inner 'if' condition is always
true.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c

index 71e79597f940a20b7eb49d35e5bcccf5d2c60963..6ed1c02cfc94486c983010564e068249d5303d5d 100644 (file)
@@ -693,8 +693,7 @@ static int decrypt_skb(struct sock *sk, struct sk_buff *skb,
        if (!sgout) {
                nsg = skb_cow_data(skb, 0, &unused) + 1;
                sgin = kmalloc_array(nsg, sizeof(*sgin), sk->sk_allocation);
-               if (!sgout)
-                       sgout = sgin;
+               sgout = sgin;
        }
 
        sg_init_table(sgin, nsg);