usb: xhci: move slot_id from xhci_hcd to xhci_command structure
xhci->slot_id is used for providing a way to pass slot id from the command completion handler to the function waiting for completion. It's shared by enumerations of all USB devices connected to an xhci host. Hence, it's a source for possible races. Since we've introduced command structure and the command queue to xhci driver. It's better to move slot_id from xhci_hcd structure to xhci_command structure. Hence the race source is removed. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
87e44f2aac
commit
c2d3d49bba
@@ -3706,7 +3706,7 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
|
||||
spin_unlock_irqrestore(&xhci->lock, flags);
|
||||
|
||||
wait_for_completion(command->completion);
|
||||
slot_id = xhci->slot_id;
|
||||
slot_id = command->slot_id;
|
||||
mutex_unlock(&xhci->mutex);
|
||||
|
||||
if (!slot_id || command->status != COMP_SUCCESS) {
|
||||
|
Reference in New Issue
Block a user