diff options
Diffstat (limited to 'drivers/usb/core/devices.c')
-rw-r--r-- | drivers/usb/core/devices.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c index 2684e15b813b..c0f37343a276 100644 --- a/drivers/usb/core/devices.c +++ b/drivers/usb/core/devices.c | |||
@@ -57,6 +57,7 @@ | |||
57 | #include <linux/usb.h> | 57 | #include <linux/usb.h> |
58 | #include <linux/smp_lock.h> | 58 | #include <linux/smp_lock.h> |
59 | #include <linux/usbdevice_fs.h> | 59 | #include <linux/usbdevice_fs.h> |
60 | #include <linux/mutex.h> | ||
60 | #include <asm/uaccess.h> | 61 | #include <asm/uaccess.h> |
61 | 62 | ||
62 | #include "usb.h" | 63 | #include "usb.h" |
@@ -570,7 +571,7 @@ static ssize_t usb_device_read(struct file *file, char __user *buf, size_t nbyte | |||
570 | if (!access_ok(VERIFY_WRITE, buf, nbytes)) | 571 | if (!access_ok(VERIFY_WRITE, buf, nbytes)) |
571 | return -EFAULT; | 572 | return -EFAULT; |
572 | 573 | ||
573 | down (&usb_bus_list_lock); | 574 | mutex_lock(&usb_bus_list_lock); |
574 | /* print devices for all busses */ | 575 | /* print devices for all busses */ |
575 | list_for_each_entry(bus, &usb_bus_list, bus_list) { | 576 | list_for_each_entry(bus, &usb_bus_list, bus_list) { |
576 | /* recurse through all children of the root hub */ | 577 | /* recurse through all children of the root hub */ |
@@ -580,12 +581,12 @@ static ssize_t usb_device_read(struct file *file, char __user *buf, size_t nbyte | |||
580 | ret = usb_device_dump(&buf, &nbytes, &skip_bytes, ppos, bus->root_hub, bus, 0, 0, 0); | 581 | ret = usb_device_dump(&buf, &nbytes, &skip_bytes, ppos, bus->root_hub, bus, 0, 0, 0); |
581 | usb_unlock_device(bus->root_hub); | 582 | usb_unlock_device(bus->root_hub); |
582 | if (ret < 0) { | 583 | if (ret < 0) { |
583 | up(&usb_bus_list_lock); | 584 | mutex_unlock(&usb_bus_list_lock); |
584 | return ret; | 585 | return ret; |
585 | } | 586 | } |
586 | total_written += ret; | 587 | total_written += ret; |
587 | } | 588 | } |
588 | up (&usb_bus_list_lock); | 589 | mutex_unlock(&usb_bus_list_lock); |
589 | return total_written; | 590 | return total_written; |
590 | } | 591 | } |
591 | 592 | ||