[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230725064031.4472-1-ruc_gongyuanjun@163.com>
Date: Tue, 25 Jul 2023 14:40:31 +0800
From: Yuanjun Gong <ruc_gongyuanjun@....com>
To: dsahern@...nel.org
Cc: herbert@...dor.apana.org.au,
netdev@...r.kernel.org,
ruc_gongyuanjun@....com,
steffen.klassert@...unet.com
Subject: [PATCH v2 1/1] net: ipv4: fix return value check in esp_remove_trailer()
return an error number if an unexpected result is returned by
pskb_tirm() in esp_remove_trailer().
Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@....com>
---
net/ipv4/esp4.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index ba06ed42e428..b435e3fe4dc6 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -732,7 +732,9 @@ static inline int esp_remove_trailer(struct sk_buff *skb)
skb->csum = csum_block_sub(skb->csum, csumdiff,
skb->len - trimlen);
}
- pskb_trim(skb, skb->len - trimlen);
+ ret = pskb_trim(skb, skb->len - trimlen);
+ if (ret)
+ goto out;
ret = nexthdr[1];
--
2.17.1
Powered by blists - more mailing lists