From: Stephen Warren Date: Wed, 23 Mar 2016 04:28:16 +0000 (-0600) Subject: smsc95xx: fix operation on 64-bit systems X-Git-Tag: v2016.05-rc1~92 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e320f0bc9b81076e4c59d281dff1428df5324809;p=oweals%2Fu-boot.git smsc95xx: fix operation on 64-bit systems smsc95xx_read_reg() should calculate sizeof(*data) not sizeof(data) since data is a pointer, and the value pointed at is being transferred over USB, not the value of the pointer. This fixes operation of the driver in 64-bit builds, such as the Raspberry Pi 3. Reported-by: Eric Anholt Signed-off-by: Stephen Warren Acked-by: Marek Vasut Acked-by: Joe Hershberger --- diff --git a/drivers/usb/eth/smsc95xx.c b/drivers/usb/eth/smsc95xx.c index 3099bf4fd4..08eaed5c2e 100644 --- a/drivers/usb/eth/smsc95xx.c +++ b/drivers/usb/eth/smsc95xx.c @@ -188,10 +188,10 @@ static int smsc95xx_read_reg(struct usb_device *udev, u32 index, u32 *data) len = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, - 0, index, tmpbuf, sizeof(data), + 0, index, tmpbuf, sizeof(*data), USB_CTRL_GET_TIMEOUT); *data = tmpbuf[0]; - if (len != sizeof(data)) { + if (len != sizeof(*data)) { debug("smsc95xx_read_reg failed: index=%d, len=%d", index, len); return -EIO;