From: Jiri Pinkava Date: Sun, 20 Jun 2010 18:05:52 +0000 (+0200) Subject: USB: gadget eth: Fix calculate CRC32 in EEM X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=03ab7461df3c74c9418c3f5485ea1127ece1ff79;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: Jiri Pinkava Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/f_eem.c b/drivers/usb/gadget/f_eem.c index 38226e9a371d..95dd4662d6a8 100644 --- a/drivers/usb/gadget/f_eem.c +++ b/drivers/usb/gadget/f_eem.c @@ -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);