Commit 03ab7461 authored by Jiri Pinkava's avatar Jiri Pinkava Committed by Greg Kroah-Hartman

USB: gadget eth: Fix calculate CRC32 in EEM

CRC should be calculated for Ethernet frame, not for whole recievede EEM data.
This bug shows rarely, because in many times len == skb->len.
Signed-off-by: default avatarJiri Pinkava <jiri.pinkava@vscht.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0d152de5
......@@ -469,8 +469,7 @@ static int eem_unwrap(struct gether *port,
crc = get_unaligned_le32(skb->data + len
- ETH_FCS_LEN);
crc2 = ~crc32_le(~0,
skb->data,
skb->len - ETH_FCS_LEN);
skb->data, len - ETH_FCS_LEN);
} else {
crc = get_unaligned_be32(skb->data + len
- ETH_FCS_LEN);
......
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