diff options
author | Xenia Ragiadakou <burzalodowa@gmail.com> | 2014-03-07 13:23:55 +1100 |
---|---|---|
committer | Eli Qiao <taget@linux.vnet.ibm.com> | 2014-03-10 11:40:33 +0800 |
commit | becd0834f5ee3879dae0cc4074bcc7d5b8766122 (patch) | |
tree | bcfcc10af90f5a2d8cc9b1a549fadc821992eb94 | |
parent | b62569cd7aac61c98b1f5142206bc2b2820dba37 (diff) | |
download | powerkvm-becd0834f5ee3879dae0cc4074bcc7d5b8766122.tar.gz |
xhci: fix incorrect type in assignment in handle_device_notification()
This patch converts Event TRB's 3rd field, which has type le32, to CPU
byteorder before using it to retrieve the Slot ID with TRB_TO_SLOT_ID macro.
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>
[Backport of 7e76ad431545d013911ddc744843118b43d01e89]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index bcfb08e41eb6a9..8ba0af4f580237 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -1580,7 +1580,7 @@ static void handle_device_notification(struct xhci_hcd *xhci, u32 slot_id; struct usb_device *udev; - slot_id = TRB_TO_SLOT_ID(event->generic.field[3]); + slot_id = TRB_TO_SLOT_ID(le32_to_cpu(event->generic.field[3])); if (!xhci->devs[slot_id]) { xhci_warn(xhci, "Device Notification event for " "unused slot %u\n", slot_id); |