usb: core: message: don't print on ENOMEM
authorWolfram Sang <wsa-dev@sang-engineering.com>
Thu, 25 Aug 2016 17:39:00 +0000 (19:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Aug 2016 17:17:36 +0000 (19:17 +0200)
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>
drivers/usb/core/message.c

index 0406a59..5ab5c1a 100644 (file)
@@ -1760,17 +1760,14 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
                nintf = cp->desc.bNumInterfaces;
                new_interfaces = kmalloc(nintf * sizeof(*new_interfaces),
                                GFP_NOIO);
-               if (!new_interfaces) {
-                       dev_err(&dev->dev, "Out of memory\n");
+               if (!new_interfaces)
                        return -ENOMEM;
-               }
 
                for (; n < nintf; ++n) {
                        new_interfaces[n] = kzalloc(
                                        sizeof(struct usb_interface),
                                        GFP_NOIO);
                        if (!new_interfaces[n]) {
-                               dev_err(&dev->dev, "Out of memory\n");
                                ret = -ENOMEM;
 free_interfaces:
                                while (--n >= 0)