From: Markus Elfring Date: Thu, 22 Aug 2019 16:00:40 +0000 (+0200) Subject: net/core/skmsg: Delete an unnecessary check before the function call “consume_skb” X-Git-Tag: v5.4-rc1~131^2~156 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd016aca28f67603f32c4e666805db519df2120a;p=thirdparty%2Fkernel%2Flinux.git net/core/skmsg: Delete an unnecessary check before the function call “consume_skb” 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 Acked-by: Song Liu Signed-off-by: David S. Miller --- diff --git a/net/core/skmsg.c b/net/core/skmsg.c index 6832eeb4b7854..cf390e0aa73dc 100644 --- a/net/core/skmsg.c +++ b/net/core/skmsg.c @@ -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; }