[PATCH 1/2] usbnet: Delete an error message for a failed memory allocation in usbnet_write_cmd_async()
From: SF Markus Elfring
Date: Mon May 22 2017 - 01:09:22 EST
From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 May 2017 06:33:48 +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@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/net/usb/usbnet.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 79048e72c1bd..802ba68d37d1 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -2124,10 +2124,7 @@ int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype,
if (data) {
buf = kmemdup(data, size, GFP_ATOMIC);
- if (!buf) {
- netdev_err(dev->net, "Error allocating buffer"
- " in %s!\n", __func__);
+ if (!buf)
goto fail_free;
- }
}
--
2.13.0