net/core/skmsg: Delete an unnecessary check before the function call “consume_skb”
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 22 Aug 2019 16:00:40 +0000 (18:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 24 Aug 2019 23:24:53 +0000 (16:24 -0700)
The consume_skb() function performs also input parameter validation.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skmsg.c

index 6832eeb4b785464f873d073f5cd3b41fdf956034..cf390e0aa73dcd926de83f780a8d562fc741c27d 100644 (file)
@@ -190,8 +190,7 @@ static int __sk_msg_free(struct sock *sk, struct sk_msg *msg, u32 i,
                sk_msg_check_to_free(msg, i, msg->sg.size);
                sge = sk_msg_elem(msg, i);
        }
-       if (msg->skb)
-               consume_skb(msg->skb);
+       consume_skb(msg->skb);
        sk_msg_init(msg);
        return freed;
 }