summaryrefslogtreecommitdiffstats
path: root/net/tls
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2018-04-24 14:36:58 +0200
committerDavid S. Miller <davem@davemloft.net>2018-04-24 22:02:10 +0200
commit95ad7544ad3f6cf585e5b8587e7d520fa3a43ad5 (patch)
tree1b20d4226029e9f65c710dd50fa641f6f323c89d /net/tls
parentfsl/fman_port: remove redundant check on port->rev_info.major (diff)
downloadlinux-95ad7544ad3f6cf585e5b8587e7d520fa3a43ad5.tar.xz
linux-95ad7544ad3f6cf585e5b8587e7d520fa3a43ad5.zip
net/tls: remove redundant second null check on sgout
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>
Diffstat (limited to 'net/tls')
-rw-r--r--net/tls/tls_sw.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 71e79597f940..6ed1c02cfc94 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -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);