Skip to contentSkip to conversation

ezusb: Delete an error message for a failed memory allocation in ezusb_writememory()

PATCH New SF Markus Elfring 1 participant 1 message May 19, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ezusb: Delete an error message for a failed memory allocation in ezusb_writememory()

From: Markus Elfring <[email protected]>
Date: Fri, 19 May 2017 22:30:21 +0200

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 drivers/usb/misc/ezusb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/usb/misc/ezusb.c +2 -4
index 837208f14f86..6d5e468dc897 100644
@@ -41,11 +41,9 @@ static int ezusb_writememory(struct usb_device *dev, int address,
 		return -ENODEV;
 
 	transfer_buffer = kmemdup(data, length, GFP_KERNEL);
-	if (!transfer_buffer) {
-		dev_err(&dev->dev, "%s - kmalloc(%d) failed.\n",
-							__func__, length);
+	if (!transfer_buffer)
 		return -ENOMEM;
-	}
+
 	result = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), request,
 				 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 				 address, 0, transfer_buffer, length, 3000);
Signature · 1 line
2.13.0