Commit d4edb506 authored by Artem Chernyshev's avatar Artem Chernyshev Committed by Jakub Kicinski

net: dsa: hellcreek: Check return value

Return NULL if we got unexpected value from skb_trim_rcsum()
in hellcreek_rcv()

Fixes: 01ef09ca ("net: dsa: Add tag handling for Hirschmann Hellcreek switches")
Signed-off-by: default avatarArtem Chernyshev <artem.chernyshev@red-soft.ru>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Kurt Kanzenbach's avatarKurt Kanzenbach <kurt@linutronix.de>
Link: https://lore.kernel.org/r/20221201140032.26746-2-artem.chernyshev@red-soft.ruSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 3d8fdcbf
...@@ -49,7 +49,8 @@ static struct sk_buff *hellcreek_rcv(struct sk_buff *skb, ...@@ -49,7 +49,8 @@ static struct sk_buff *hellcreek_rcv(struct sk_buff *skb,
return NULL; 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); dsa_default_offload_fwd_mark(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment