diff options
Diffstat (limited to 'drivers/usb/core/devices.c')
-rw-r--r-- | drivers/usb/core/devices.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c index f460de31acee..cbacea933b18 100644 --- a/drivers/usb/core/devices.c +++ b/drivers/usb/core/devices.c | |||
@@ -591,16 +591,14 @@ static ssize_t usb_device_dump(char __user **buffer, size_t *nbytes, | |||
591 | 591 | ||
592 | /* Now look at all of this device's children. */ | 592 | /* Now look at all of this device's children. */ |
593 | usb_hub_for_each_child(usbdev, chix, childdev) { | 593 | usb_hub_for_each_child(usbdev, chix, childdev) { |
594 | if (childdev) { | 594 | usb_lock_device(childdev); |
595 | usb_lock_device(childdev); | 595 | ret = usb_device_dump(buffer, nbytes, skip_bytes, |
596 | ret = usb_device_dump(buffer, nbytes, skip_bytes, | 596 | file_offset, childdev, bus, |
597 | file_offset, childdev, bus, | 597 | level + 1, chix - 1, ++cnt); |
598 | level + 1, chix - 1, ++cnt); | 598 | usb_unlock_device(childdev); |
599 | usb_unlock_device(childdev); | 599 | if (ret == -EFAULT) |
600 | if (ret == -EFAULT) | 600 | return total_written; |
601 | return total_written; | 601 | total_written += ret; |
602 | total_written += ret; | ||
603 | } | ||
604 | } | 602 | } |
605 | return total_written; | 603 | return total_written; |
606 | } | 604 | } |