Commit 323ece54 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

cdc-wdm: fix endianness bug in debug statements

Values directly from descriptors given in debug statements
must be converted to native endianness.
Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
CC: stable@vger.kernel.org
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 28965e17
...@@ -245,7 +245,7 @@ static void wdm_int_callback(struct urb *urb) ...@@ -245,7 +245,7 @@ static void wdm_int_callback(struct urb *urb)
case USB_CDC_NOTIFY_RESPONSE_AVAILABLE: case USB_CDC_NOTIFY_RESPONSE_AVAILABLE:
dev_dbg(&desc->intf->dev, dev_dbg(&desc->intf->dev,
"NOTIFY_RESPONSE_AVAILABLE received: index %d len %d", "NOTIFY_RESPONSE_AVAILABLE received: index %d len %d",
dr->wIndex, dr->wLength); le16_to_cpu(dr->wIndex), le16_to_cpu(dr->wLength));
break; break;
case USB_CDC_NOTIFY_NETWORK_CONNECTION: case USB_CDC_NOTIFY_NETWORK_CONNECTION:
...@@ -262,7 +262,9 @@ static void wdm_int_callback(struct urb *urb) ...@@ -262,7 +262,9 @@ static void wdm_int_callback(struct urb *urb)
clear_bit(WDM_POLL_RUNNING, &desc->flags); clear_bit(WDM_POLL_RUNNING, &desc->flags);
dev_err(&desc->intf->dev, dev_err(&desc->intf->dev,
"unknown notification %d received: index %d len %d\n", "unknown notification %d received: index %d len %d\n",
dr->bNotificationType, dr->wIndex, dr->wLength); dr->bNotificationType,
le16_to_cpu(dr->wIndex),
le16_to_cpu(dr->wLength));
goto exit; goto exit;
} }
...@@ -402,7 +404,7 @@ static ssize_t wdm_write ...@@ -402,7 +404,7 @@ static ssize_t wdm_write
USB_RECIP_INTERFACE); USB_RECIP_INTERFACE);
req->bRequest = USB_CDC_SEND_ENCAPSULATED_COMMAND; req->bRequest = USB_CDC_SEND_ENCAPSULATED_COMMAND;
req->wValue = 0; req->wValue = 0;
req->wIndex = desc->inum; req->wIndex = desc->inum; /* already converted */
req->wLength = cpu_to_le16(count); req->wLength = cpu_to_le16(count);
set_bit(WDM_IN_USE, &desc->flags); set_bit(WDM_IN_USE, &desc->flags);
desc->outbuf = buf; desc->outbuf = buf;
...@@ -416,7 +418,7 @@ static ssize_t wdm_write ...@@ -416,7 +418,7 @@ static ssize_t wdm_write
goto out_free_mem_pm; goto out_free_mem_pm;
} else { } else {
dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d", dev_dbg(&desc->intf->dev, "Tx URB has been submitted index=%d",
req->wIndex); le16_to_cpu(req->wIndex));
} }
usb_autopm_put_interface(desc->intf); usb_autopm_put_interface(desc->intf);
...@@ -821,7 +823,7 @@ static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor ...@@ -821,7 +823,7 @@ static int wdm_create(struct usb_interface *intf, struct usb_endpoint_descriptor
desc->irq->bRequestType = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE); desc->irq->bRequestType = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE);
desc->irq->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE; desc->irq->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE;
desc->irq->wValue = 0; desc->irq->wValue = 0;
desc->irq->wIndex = desc->inum; desc->irq->wIndex = desc->inum; /* already converted */
desc->irq->wLength = cpu_to_le16(desc->wMaxCommand); desc->irq->wLength = cpu_to_le16(desc->wMaxCommand);
usb_fill_control_urb( usb_fill_control_urb(
......
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