diff options
author | Xenia Ragiadakou <burzalodowa@gmail.com> | 2013-11-14 20:18:07 -0500 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2013-12-02 15:59:45 -0500 |
commit | 0c052aabe66c495bf1248f301a8e745da66c6633 (patch) | |
tree | e9fb325474142b377395aadc6dd3898b13c0f1a6 /drivers/usb/host/xhci.c | |
parent | d20c72256721411f55eb95beddf1d8a5d5da31eb (diff) |
xhci: fix incorrect type in assignment in xhci_address_device()
The field 'dev_info' in struct xhci_slot_ctx has type __le32 and it needs
to be converted to CPU byteorder for the correct retrieval of its subfield
'Context Entries'. This field is used by the trace event 'xhci_address_ctx'
to trace only the contexts of valid endpoints.
This bug was found using sparse.
Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci.c')
-rw-r--r-- | drivers/usb/host/xhci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 4265b48856f6..a96b35cf4fa7 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -3771,7 +3771,7 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
3771 | xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id); | 3771 | xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id); |
3772 | xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2); | 3772 | xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2); |
3773 | trace_xhci_address_ctx(xhci, virt_dev->in_ctx, | 3773 | trace_xhci_address_ctx(xhci, virt_dev->in_ctx, |
3774 | slot_ctx->dev_info >> 27); | 3774 | le32_to_cpu(slot_ctx->dev_info) >> 27); |
3775 | 3775 | ||
3776 | spin_lock_irqsave(&xhci->lock, flags); | 3776 | spin_lock_irqsave(&xhci->lock, flags); |
3777 | cmd_trb = xhci_find_next_enqueue(xhci->cmd_ring); | 3777 | cmd_trb = xhci_find_next_enqueue(xhci->cmd_ring); |
@@ -3850,7 +3850,7 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
3850 | xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id); | 3850 | xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id); |
3851 | xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2); | 3851 | xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2); |
3852 | trace_xhci_address_ctx(xhci, virt_dev->in_ctx, | 3852 | trace_xhci_address_ctx(xhci, virt_dev->in_ctx, |
3853 | slot_ctx->dev_info >> 27); | 3853 | le32_to_cpu(slot_ctx->dev_info) >> 27); |
3854 | xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id); | 3854 | xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id); |
3855 | xhci_dbg_ctx(xhci, virt_dev->out_ctx, 2); | 3855 | xhci_dbg_ctx(xhci, virt_dev->out_ctx, 2); |
3856 | /* | 3856 | /* |
@@ -3859,7 +3859,7 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
3859 | */ | 3859 | */ |
3860 | slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); | 3860 | slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); |
3861 | trace_xhci_address_ctx(xhci, virt_dev->out_ctx, | 3861 | trace_xhci_address_ctx(xhci, virt_dev->out_ctx, |
3862 | slot_ctx->dev_info >> 27); | 3862 | le32_to_cpu(slot_ctx->dev_info) >> 27); |
3863 | /* Zero the input context control for later use */ | 3863 | /* Zero the input context control for later use */ |
3864 | ctrl_ctx->add_flags = 0; | 3864 | ctrl_ctx->add_flags = 0; |
3865 | ctrl_ctx->drop_flags = 0; | 3865 | ctrl_ctx->drop_flags = 0; |