Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a31fb69

Browse files
committed
Merge tag 'usb-3.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg Kroah-Hartman: "Here are two USB bugfixes for your 3.6-rc7 tree. The OHCI fix has been reported a number of times and is a regression from 3.5, and the patch that causes the regression was on the way to the -stable trees before I was reminded (again) that this fix needed to get to your tree soon. The host controller bugfix was reported in older kernels as being pretty easy to trigger, and has been tested by Red Hat and their customers. Both have been in the usb-next branch in the -next tree for a while now, I just cherry-picked them out to get to you in time for the 3.6 release. Signed-off-by: Greg Kroah-Hartman <[email protected]>" * tag 'usb-3.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: Fix race condition when removing host controllers USB: ohci-at91: fix null pointer in ohci_hcd_at91_overcurrent_irq
2 parents 8dce30c + 0d00dc2 commit a31fb69

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

drivers/usb/core/devices.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ static ssize_t usb_device_read(struct file *file, char __user *buf,
624624
/* print devices for all busses */
625625
list_for_each_entry(bus, &usb_bus_list, bus_list) {
626626
/* recurse through all children of the root hub */
627-
if (!bus->root_hub)
627+
if (!bus_to_hcd(bus)->rh_registered)
628628
continue;
629629
usb_lock_device(bus->root_hub);
630630
ret = usb_device_dump(&buf, &nbytes, &skip_bytes, ppos,

drivers/usb/core/hcd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,10 +1011,7 @@ static int register_root_hub(struct usb_hcd *hcd)
10111011
if (retval) {
10121012
dev_err (parent_dev, "can't register root hub for %s, %d\n",
10131013
dev_name(&usb_dev->dev), retval);
1014-
}
1015-
mutex_unlock(&usb_bus_list_lock);
1016-
1017-
if (retval == 0) {
1014+
} else {
10181015
spin_lock_irq (&hcd_root_hub_lock);
10191016
hcd->rh_registered = 1;
10201017
spin_unlock_irq (&hcd_root_hub_lock);
@@ -1023,6 +1020,7 @@ static int register_root_hub(struct usb_hcd *hcd)
10231020
if (HCD_DEAD(hcd))
10241021
usb_hc_died (hcd); /* This time clean up */
10251022
}
1023+
mutex_unlock(&usb_bus_list_lock);
10261024

10271025
return retval;
10281026
}

drivers/usb/host/ohci-at91.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,8 @@ static irqreturn_t ohci_hcd_at91_overcurrent_irq(int irq, void *data)
467467
/* From the GPIO notifying the over-current situation, find
468468
* out the corresponding port */
469469
at91_for_each_port(port) {
470-
if (gpio_to_irq(pdata->overcurrent_pin[port]) == irq) {
470+
if (gpio_is_valid(pdata->overcurrent_pin[port]) &&
471+
gpio_to_irq(pdata->overcurrent_pin[port]) == irq) {
471472
gpio = pdata->overcurrent_pin[port];
472473
break;
473474
}

0 commit comments

Comments
 (0)