提交 03ab7461 编写于 作者: J Jiri Pinkava 提交者: 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: NJiri Pinkava <jiri.pinkava@vscht.cz>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 0d152de5
...@@ -469,8 +469,7 @@ static int eem_unwrap(struct gether *port, ...@@ -469,8 +469,7 @@ static int eem_unwrap(struct gether *port,
crc = get_unaligned_le32(skb->data + len crc = get_unaligned_le32(skb->data + len
- ETH_FCS_LEN); - ETH_FCS_LEN);
crc2 = ~crc32_le(~0, crc2 = ~crc32_le(~0,
skb->data, skb->data, len - ETH_FCS_LEN);
skb->len - ETH_FCS_LEN);
} else { } else {
crc = get_unaligned_be32(skb->data + len crc = get_unaligned_be32(skb->data + len
- ETH_FCS_LEN); - ETH_FCS_LEN);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册