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>] [day] [month] [year] [list]
Date:   Fri, 29 Dec 2017 20:50:54 +0100
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        Arend Van Spriel <arend.vanspriel@...adcom.com>,
        Arnd Bergmann <arnd@...db.de>, Eyal Reizer <eyalr@...com>,
        Franky Lin <franky.lin@...adcom.com>,
        "Gustavo A. R. Silva" <garsilva@...eddedor.com>,
        Iain Hunter <drhunter95@...il.com>,
        Johannes Berg <johannes.berg@...el.com>,
        Kalle Valo <kvalo@...eaurora.org>,
        Sebastian Reichel <sre@...nel.org>,
        Tony Lindgren <tony@...mide.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH] wlcore: Delete an error message for a failed memory
 allocation in three functions

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 29 Dec 2017 20:40:49 +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/net/wireless/ti/wlcore/main.c | 8 ++------
 drivers/net/wireless/ti/wlcore/spi.c  | 4 +---
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index c346c021b999..970e59871547 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -1301,10 +1301,8 @@ static struct sk_buff *wl12xx_alloc_dummy_packet(struct wl1271 *wl)
 			    sizeof(struct wl1271_tx_hw_descr) - sizeof(*hdr);
 
 	skb = dev_alloc_skb(TOTAL_TX_DUMMY_PACKET_SIZE);
-	if (!skb) {
-		wl1271_warning("Failed to allocate a dummy packet skb");
+	if (!skb)
 		return NULL;
-	}
 
 	skb_reserve(skb, sizeof(struct wl1271_tx_hw_descr));
 
@@ -1421,10 +1419,8 @@ int wl1271_rx_filter_alloc_field(struct wl12xx_rx_filter *filter,
 	field = &filter->fields[filter->num_fields];
 
 	field->pattern = kzalloc(len, GFP_KERNEL);
-	if (!field->pattern) {
-		wl1271_warning("Failed to allocate RX filter pattern");
+	if (!field->pattern)
 		return -ENOMEM;
-	}
 
 	filter->num_fields++;
 
diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index 62ce54a949e9..fc94a0d1a01d 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -489,10 +489,8 @@ static int wl1271_probe(struct spi_device *spi)
 	pdev_data->if_ops = &spi_ops;
 
 	glue = devm_kzalloc(&spi->dev, sizeof(*glue), GFP_KERNEL);
-	if (!glue) {
-		dev_err(&spi->dev, "can't allocate glue\n");
+	if (!glue)
 		return -ENOMEM;
-	}
 
 	glue->dev = &spi->dev;
 
-- 
2.15.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ