lkml.org 
[lkml]   [2017]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/4] ueagle-atm: Delete error messages for failed memory allocations in two functions
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 19 May 2017 19:02:01 +0200

Omit two extra messages for memory allocation failures in these functions.

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/atm/ueagle-atm.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index df67815f74e6..16fd87df69e1 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -868,10 +868,8 @@ static int uea_idma_write(struct uea_softc *sc, const void *data, u32 size)
int bytes_read;

xfer_buff = kmemdup(data, size, GFP_KERNEL);
- if (!xfer_buff) {
- uea_err(INS_TO_USBDEV(sc), "can't allocate xfer_buff\n");
+ if (!xfer_buff)
return ret;
- }

ret = usb_bulk_msg(sc->usb_dev,
usb_sndbulkpipe(sc->usb_dev, UEA_IDMA_PIPE),
@@ -1147,10 +1145,8 @@ static int uea_request(struct uea_softc *sc,
int ret = -ENOMEM;

xfer_buff = kmemdup(data, size, GFP_KERNEL);
- if (!xfer_buff) {
- uea_err(INS_TO_USBDEV(sc), "can't allocate xfer_buff\n");
+ if (!xfer_buff)
return ret;
- }

ret = usb_control_msg(sc->usb_dev, usb_sndctrlpipe(sc->usb_dev, 0),
UCDC_SEND_ENCAPSULATED_COMMAND,
--
2.13.0
\
 
 \ /
  Last update: 2017-05-19 19:48    [W:0.043 / U:2.524 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site