Browse Source

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>
Xenia Ragiadakou 12 years ago
parent
commit
7e76ad4315
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/usb/host/xhci-ring.c

+ 1 - 1
drivers/usb/host/xhci-ring.c

@@ -1655,7 +1655,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);