lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e465c4ba-fe61-24c0-6e5b-b37abcf87d2c@users.sourceforge.net>
Date:   Fri, 19 May 2017 19:47:27 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-usb@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Matthieu Castet <castet.matthieu@...e.fr>,
        Stanislaw Gruszka <stf_xl@...pl>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org, Wolfram Sang <wsa@...-dreams.de>
Subject: [PATCH 1/4] ueagle-atm: Delete error messages for failed memory
 allocations in two functions

From: Markus Elfring <elfring@...rs.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@...rs.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ