summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorJiri Pinkava <jiri.pinkava@vscht.cz>2010-06-20 22:05:52 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-06-30 19:16:06 +0400
commit03ab7461df3c74c9418c3f5485ea1127ece1ff79 (patch)
treed0394ffeeb19872c467ef24e2866818afe0acfb8 /drivers/usb
parent0d152de56938361fa2b960db67657b20cdaa6d84 (diff)
downloadlinux-03ab7461df3c74c9418c3f5485ea1127ece1ff79.tar.xz
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 <jiri.pinkava@vscht.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/f_eem.c3
1 files changed, 1 insertions, 2 deletions
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);