USB: emi62: Delete an error message for a failed memory allocation in emi62_writememory()
Subsystems (2)
PATCH 1/1 USB: emi62: Delete an error message for a failed memory allocation in emi62_writememory()
From: Markus Elfring <[email protected]>
Date: Wed, 6 Dec 2017 12:42:20 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
--- drivers/usb/misc/emi62.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/usb/misc/emi62.c +2 -3
@@ -51,10 +51,9 @@ static int emi62_writememory(struct usb_device *dev, int address,int result;unsigned char *buffer =kmemdup (data, length,GFP_KERNEL ); -if (!buffer) { -dev_err (&dev->dev,"kmalloc(%d) failed.\n" , length); +if (!buffer)return -ENOMEM ; - } +/* Note: usb_control_msg returns negative value on error or length of the * data that was written! */ result =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), request,0x40 , address,0 , buffer, length,300 );
Signature · 1 line
2.15.1