diff options
author | Wolfram Sang <wsa-dev@sang-engineering.com> | 2016-08-25 13:38:59 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-30 13:17:36 -0400 |
commit | b74e7062366af5b372b0f8ee5781c5e713ef67ad (patch) | |
tree | 5d19a9029ee341acec9fc6a9481e629b7eccb769 /drivers/usb | |
parent | 36af2db8709246a00670314feca728a014e320bd (diff) |
usb: core: hub: don't print on ENOMEM
All kmalloc-based functions print enough information on failures.
Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/hub.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 1d5fc32d06d0..b48dc76385b6 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1823,10 +1823,8 @@ descriptor_error: | |||
1823 | dev_info(&intf->dev, "USB hub found\n"); | 1823 | dev_info(&intf->dev, "USB hub found\n"); |
1824 | 1824 | ||
1825 | hub = kzalloc(sizeof(*hub), GFP_KERNEL); | 1825 | hub = kzalloc(sizeof(*hub), GFP_KERNEL); |
1826 | if (!hub) { | 1826 | if (!hub) |
1827 | dev_dbg(&intf->dev, "couldn't kmalloc hub struct\n"); | ||
1828 | return -ENOMEM; | 1827 | return -ENOMEM; |
1829 | } | ||
1830 | 1828 | ||
1831 | kref_init(&hub->kref); | 1829 | kref_init(&hub->kref); |
1832 | hub->intfdev = &intf->dev; | 1830 | hub->intfdev = &intf->dev; |
@@ -5337,11 +5335,10 @@ static int descriptors_changed(struct usb_device *udev, | |||
5337 | } | 5335 | } |
5338 | 5336 | ||
5339 | buf = kmalloc(len, GFP_NOIO); | 5337 | buf = kmalloc(len, GFP_NOIO); |
5340 | if (buf == NULL) { | 5338 | if (!buf) |
5341 | dev_err(&udev->dev, "no mem to re-read configs after reset\n"); | ||
5342 | /* assume the worst */ | 5339 | /* assume the worst */ |
5343 | return 1; | 5340 | return 1; |
5344 | } | 5341 | |
5345 | for (index = 0; index < udev->descriptor.bNumConfigurations; index++) { | 5342 | for (index = 0; index < udev->descriptor.bNumConfigurations; index++) { |
5346 | old_length = le16_to_cpu(udev->config[index].desc.wTotalLength); | 5343 | old_length = le16_to_cpu(udev->config[index].desc.wTotalLength); |
5347 | length = usb_get_descriptor(udev, USB_DT_CONFIG, index, buf, | 5344 | length = usb_get_descriptor(udev, USB_DT_CONFIG, index, buf, |