diff options
author | Yuanjun Gong <ruc_gongyuanjun@163.com> | 2023-07-17 16:49:02 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-07-19 13:27:09 +0200 |
commit | 02d84f3eb53a5be982b17c88410fa6c58806356b (patch) | |
tree | 8e039857aa17e726581e15773c866321ec78be1c /net/ipv4/ip_gre.c | |
parent | drivers:net: fix return value check in ocelot_fdma_receive_skb (diff) | |
download | linux-02d84f3eb53a5be982b17c88410fa6c58806356b.tar.xz linux-02d84f3eb53a5be982b17c88410fa6c58806356b.zip |
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 '')
-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; } |