mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-13 16:50:05 +00:00
net: dsa: add error handling for pskb_trim_rcsum
When pskb_trim_rcsum fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling pskb_trim_rcsum. Signed-off-by: Zhouyang Jia <jiazhouyang09@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0975764684
commit
349b71d6f4
@ -75,7 +75,8 @@ static struct sk_buff *trailer_rcv(struct sk_buff *skb, struct net_device *dev,
|
||||
if (!skb->dev)
|
||||
return NULL;
|
||||
|
||||
pskb_trim_rcsum(skb, skb->len - 4);
|
||||
if (pskb_trim_rcsum(skb, skb->len - 4))
|
||||
return NULL;
|
||||
|
||||
return skb;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user