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

index 9c49334..7717651 100644 (file)
@@ -245,10 +245,8 @@ static ssize_t get_dev_desc_store(struct device *dev,
        int ret;
 
        descriptor = kmalloc(sizeof(*descriptor), GFP_KERNEL);
-       if (!descriptor) {
-               dev_err(dev, "failed to allocate descriptor memory\n");
+       if (!descriptor)
                return -ENOMEM;
-       }
 
        udev = create_lvs_device(intf);
        if (!udev) {