aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-09-27 19:49:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-09-27 19:49:15 -0400
commita31fb6988a37f46f3a677aa5bc982094f3a03567 (patch)
tree33e7c47fea41aa4dee69724c4aab9a142dc1cbcc
parent8dce30c89113e314d29d3b8f362aadff8087fccb (diff)
parent0d00dc2611abbe6ad244d50569c2ee82ce42846c (diff)
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 <gregkh@linuxfoundation.org>" * 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
-rw-r--r--drivers/usb/core/devices.c2
-rw-r--r--drivers/usb/core/hcd.c6
-rw-r--r--drivers/usb/host/ohci-at91.c3
3 files changed, 5 insertions, 6 deletions
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index d95696584762..3440812b4a84 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -624,7 +624,7 @@ static ssize_t usb_device_read(struct file *file, char __user *buf,
624 /* print devices for all busses */ 624 /* print devices for all busses */
625 list_for_each_entry(bus, &usb_bus_list, bus_list) { 625 list_for_each_entry(bus, &usb_bus_list, bus_list) {
626 /* recurse through all children of the root hub */ 626 /* recurse through all children of the root hub */
627 if (!bus->root_hub) 627 if (!bus_to_hcd(bus)->rh_registered)
628 continue; 628 continue;
629 usb_lock_device(bus->root_hub); 629 usb_lock_device(bus->root_hub);
630 ret = usb_device_dump(&buf, &nbytes, &skip_bytes, ppos, 630 ret = usb_device_dump(&buf, &nbytes, &skip_bytes, ppos,
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index bc84106ac057..75ba2091f9b4 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1011,10 +1011,7 @@ static int register_root_hub(struct usb_hcd *hcd)
1011 if (retval) { 1011 if (retval) {
1012 dev_err (parent_dev, "can't register root hub for %s, %d\n", 1012 dev_err (parent_dev, "can't register root hub for %s, %d\n",
1013 dev_name(&usb_dev->dev), retval); 1013 dev_name(&usb_dev->dev), retval);
1014 } 1014 } else {
1015 mutex_unlock(&usb_bus_list_lock);
1016
1017 if (retval == 0) {
1018 spin_lock_irq (&hcd_root_hub_lock); 1015 spin_lock_irq (&hcd_root_hub_lock);
1019 hcd->rh_registered = 1; 1016 hcd->rh_registered = 1;
1020 spin_unlock_irq (&hcd_root_hub_lock); 1017 spin_unlock_irq (&hcd_root_hub_lock);
@@ -1023,6 +1020,7 @@ static int register_root_hub(struct usb_hcd *hcd)
1023 if (HCD_DEAD(hcd)) 1020 if (HCD_DEAD(hcd))
1024 usb_hc_died (hcd); /* This time clean up */ 1021 usb_hc_died (hcd); /* This time clean up */
1025 } 1022 }
1023 mutex_unlock(&usb_bus_list_lock);
1026 1024
1027 return retval; 1025 return retval;
1028} 1026}
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index aaa8d2bce217..0bf72f943b00 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -467,7 +467,8 @@ static irqreturn_t ohci_hcd_at91_overcurrent_irq(int irq, void *data)
467 /* From the GPIO notifying the over-current situation, find 467 /* From the GPIO notifying the over-current situation, find
468 * out the corresponding port */ 468 * out the corresponding port */
469 at91_for_each_port(port) { 469 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) {
471 gpio = pdata->overcurrent_pin[port]; 472 gpio = pdata->overcurrent_pin[port];
472 break; 473 break;
473 } 474 }