projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0975764
)
net: dsa: add error handling for pskb_trim_rcsum
author
Zhouyang Jia
<jiazhouyang09@gmail.com>
Mon, 11 Jun 2018 05:26:35 +0000
(13:26 +0800)
committer
David S. Miller
<davem@davemloft.net>
Mon, 11 Jun 2018 21:19:38 +0000
(14:19 -0700)
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>
net/dsa/tag_trailer.c
patch
|
blob
|
history
diff --git
a/net/dsa/tag_trailer.c
b/net/dsa/tag_trailer.c
index 7d20e1f3de28a4826a9e39667a2a7a1a931cbb2b..56197f0d9608de25b857ad2f902c554002a2929b 100644
(file)
--- a/
net/dsa/tag_trailer.c
+++ b/
net/dsa/tag_trailer.c
@@
-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;
}