Commit 6809d216 authored by Ben Dooks's avatar Ben Dooks Committed by David S. Miller

usbnet: smsc95xx: fix memcpy for accessing rx-data

Change the RX code to use get_unaligned_le32() instead of the combo
of memcpy and cpu_to_le32s(&var).
Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0c8b2655
...@@ -618,9 +618,7 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb) ...@@ -618,9 +618,7 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb)
return; return;
} }
memcpy(&intdata, urb->transfer_buffer, 4); intdata = get_unaligned_le32(urb->transfer_buffer);
le32_to_cpus(&intdata);
netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata); netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata);
if (intdata & INT_ENP_PHY_INT_) if (intdata & INT_ENP_PHY_INT_)
...@@ -1934,8 +1932,7 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -1934,8 +1932,7 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
unsigned char *packet; unsigned char *packet;
u16 size; u16 size;
memcpy(&header, skb->data, sizeof(header)); header = get_unaligned_le32(skb->data);
le32_to_cpus(&header);
skb_pull(skb, 4 + NET_IP_ALIGN); skb_pull(skb, 4 + NET_IP_ALIGN);
packet = skb->data; packet = skb->data;
......
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