* [PATCH] ezusb: Delete an error message for a failed memory allocation in ezusb_writememory()
@ 2017-05-19 20:37 SF Markus Elfring
0 siblings, 0 replies; only message in thread
From: SF Markus Elfring @ 2017-05-19 20:37 UTC (permalink / raw)
To: linux-usb, Greg Kroah-Hartman, Julia Lawall
Cc: LKML, kernel-janitors, Wolfram Sang
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/usb/misc/ezusb.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/misc/ezusb.c b/drivers/usb/misc/ezusb.c
index 837208f14f86..6d5e468dc897 100644
--- a/drivers/usb/misc/ezusb.c
+++ b/drivers/usb/misc/ezusb.c
@@ -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);
--
2.13.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-05-19 20:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-19 20:37 [PATCH] ezusb: Delete an error message for a failed memory allocation in ezusb_writememory() SF Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®