diff options
author | Yuanjun Gong <ruc_gongyuanjun@163.com> | 2023-07-17 17:49:02 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-07-19 14:27:09 +0300 |
commit | 02d84f3eb53a5be982b17c88410fa6c58806356b (patch) | |
tree | 8e039857aa17e726581e15773c866321ec78be1c /net/ipv4 | |
parent | bce5603365d8184734ba7e6b22e74bd2c90a7167 (diff) | |
download | linux-02d84f3eb53a5be982b17c88410fa6c58806356b.tar.xz |
ipv4: ip_gre: fix return value check in erspan_fb_xmit()
goto err_free_skb if an unexpected result is returned by pskb_tirm()
in erspan_fb_xmit().
Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_gre.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 81a1cce1a7d1..914cc941af55 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -548,7 +548,8 @@ static void erspan_fb_xmit(struct sk_buff *skb, struct net_device *dev) goto err_free_skb; if (skb->len > dev->mtu + dev->hard_header_len) { - pskb_trim(skb, dev->mtu + dev->hard_header_len); + if (pskb_trim(skb, dev->mtu + dev->hard_header_len)) + goto err_free_skb; truncate = true; } |