Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -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);