From: Xenia Ragiadakou Date: Mon, 9 Sep 2013 18:03:10 +0000 (+0300) Subject: xhci: fix incorrect type in assignment in handle_device_notification() X-Git-Tag: v3.14-rc1~148^2~130^2~65^2~13 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=7e76ad431545d013911ddc744843118b43d01e89;p=~emulex%2Finfiniband.git 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 Signed-off-by: Sarah Sharp --- diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 1e2f3f49584..22da09388a7 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/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);