Skip to content

Commit 95ad754

Browse files
Colin Ian Kingdavem330
Colin Ian King
authored andcommitted
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>
1 parent 080aadd commit 95ad754

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/tls/tls_sw.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,8 +693,7 @@ static int decrypt_skb(struct sock *sk, struct sk_buff *skb,
693693
if (!sgout) {
694694
nsg = skb_cow_data(skb, 0, &unused) + 1;
695695
sgin = kmalloc_array(nsg, sizeof(*sgin), sk->sk_allocation);
696-
if (!sgout)
697-
sgout = sgin;
696+
sgout = sgin;
698697
}
699698

700699
sg_init_table(sgin, nsg);

0 commit comments

Comments
 (0)