[PATCH 4/4] uwb/i1480/dfu/usb: Delete two error messages for a failed memory allocation in i1480_usb_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 5 Dec 2017 21:07:47 +0100

Omit extra messages for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
 drivers/uwb/i1480/dfu/usb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/uwb/i1480/dfu/usb.c b/drivers/uwb/i1480/dfu/usb.c
index a50cf45e530f..56bbdc5504d4 100644
--- a/drivers/uwb/i1480/dfu/usb.c
+++ b/drivers/uwb/i1480/dfu/usb.c
@@ -366,10 +366,9 @@ int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id)
 	if (iface->cur_altsetting->desc.bNumEndpoints < 1)
 		return -ENODEV;
 
-	result = -ENOMEM;
 	i1480_usb = kzalloc(sizeof(*i1480_usb), GFP_KERNEL);
 	if (i1480_usb == NULL) {
-		dev_err(dev, "Unable to allocate instance\n");
+		result = -ENOMEM;
 		goto error;
 	}
 	i1480_usb_init(i1480_usb);
@@ -378,7 +377,6 @@ int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id)
 	i1480->buf_size = 512;
 	i1480->cmd_buf = kmalloc(2 * i1480->buf_size, GFP_KERNEL);
 	if (i1480->cmd_buf == NULL) {
-		dev_err(dev, "Cannot allocate transfer buffers\n");
 		result = -ENOMEM;
 		goto error_buf_alloc;
 	}
-- 
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux