summaryrefslogtreecommitdiff
path: root/net/core/skmsg.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2019-08-22 19:00:40 +0300
committerDavid S. Miller <davem@davemloft.net>2019-08-25 02:24:53 +0300
commitdd016aca28f67603f32c4e666805db519df2120a (patch)
treefd5f084abec72b33b85ab7315436944b09e586c7 /net/core/skmsg.c
parent2307f4a517c7dbb26fe0c0513ee0ba9d3239362f (diff)
downloadlinux-dd016aca28f67603f32c4e666805db519df2120a.tar.xz
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 <elfring@users.sourceforge.net> Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/skmsg.c')
-rw-r--r--net/core/skmsg.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/core/skmsg.c b/net/core/skmsg.c
index 6832eeb4b785..cf390e0aa73d 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;
}