aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Chernyshev <[email protected]>2022-12-01 17:00:31 +0300
committerJakub Kicinski <[email protected]>2022-12-02 20:46:52 -0800
commitd4edb50688652eb10be270bc515da63815de428f (patch)
treeb8b6d7d63316e346271ceaea6a006ee9a9c8b169
parent3d8fdcbf1f42e2bb9ae8b8c0b6f202278c788a22 (diff)
net: dsa: hellcreek: Check return value
Return NULL if we got unexpected value from skb_trim_rcsum() in hellcreek_rcv() Fixes: 01ef09caad66 ("net: dsa: Add tag handling for Hirschmann Hellcreek switches") Signed-off-by: Artem Chernyshev <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Kurt Kanzenbach <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
-rw-r--r--net/dsa/tag_hellcreek.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/dsa/tag_hellcreek.c b/net/dsa/tag_hellcreek.c
index 846588c0070a..53a206d11685 100644
--- a/net/dsa/tag_hellcreek.c
+++ b/net/dsa/tag_hellcreek.c
@@ -49,7 +49,8 @@ static struct sk_buff *hellcreek_rcv(struct sk_buff *skb,
return NULL;
}
- pskb_trim_rcsum(skb, skb->len - HELLCREEK_TAG_LEN);
+ if (pskb_trim_rcsum(skb, skb->len - HELLCREEK_TAG_LEN))
+ return NULL;
dsa_default_offload_fwd_mark(skb);