Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1645792 > unrolled thread

[PATCH 1/4] ueagle-atm: Delete error messages for failed memory allocations in two functions

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-05-19 19:50 +0200
Last post2017-05-19 19:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/4] ueagle-atm: Delete error messages for failed memory  allocations in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-19 19:50 +0200

#1645792 — [PATCH 1/4] ueagle-atm: Delete error messages for failed memory allocations in two functions

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-05-19 19:50 +0200
Subject[PATCH 1/4] ueagle-atm: Delete error messages for failed memory allocations in two functions
Message-ID<tIUch-5rg-1@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web