提交 349b71d6 编写于 作者: Z Zhouyang Jia 提交者: David S. Miller

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: NZhouyang Jia <jiazhouyang09@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 09757646
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册