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: <c22708e9-bd7f-71fa-d70c-eed78a04de01@users.sourceforge.net>
Date:   Thu, 28 Dec 2017 22:46:54 +0100
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-pcmcia@...ts.infradead.org,
        Bhumika Goyal <bhumirks@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 2/3] pcmcia/cis: Delete an error message for a failed memory
 allocation in two functions

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 28 Dec 2017 22:20:51 +0100

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/pcmcia/pcmcia_cis.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/pcmcia/pcmcia_cis.c b/drivers/pcmcia/pcmcia_cis.c
index 1c05d74e850d..ffcd014b7bc1 100644
--- a/drivers/pcmcia/pcmcia_cis.c
+++ b/drivers/pcmcia/pcmcia_cis.c
@@ -43,10 +43,9 @@ int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function,
 	int ret;
 
 	buf = kmalloc(256, GFP_KERNEL);
-	if (buf == NULL) {
-		dev_warn(&s->dev, "no memory to read tuple\n");
+	if (!buf)
 		return -ENOMEM;
-	}
+
 	tuple.DesiredTuple = code;
 	tuple.Attributes = 0;
 	if (function == BIND_FN_ALL)
@@ -93,10 +92,8 @@ int pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function,
 	int ret;
 
 	buf = kzalloc(256, GFP_KERNEL);
-	if (buf == NULL) {
-		dev_warn(&s->dev, "no memory to read tuple\n");
+	if (!buf)
 		return -ENOMEM;
-	}
 
 	tuple.TupleData = buf;
 	tuple.TupleDataMax = 255;
-- 
2.15.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ