From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
Arend Van Spriel <arend.vanspriel@broadcom.com>,
Arnd Bergmann <arnd@arndb.de>, Eyal Reizer <eyalr@ti.com>,
Franky Lin <franky.lin@broadcom.com>,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>,
Iain Hunter <drhunter95@gmail.com>,
Johannes Berg <johannes.berg@intel.com>,
Kalle Valo <kvalo@codeaurora.org>,
Sebastian Reichel <sre@kernel.org>,
Tony Lindgren <tony@atomide.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] wlcore: Delete an error message for a failed memory allocation in three functions
Date: Fri, 29 Dec 2017 20:50:54 +0100 [thread overview]
Message-ID: <a5e86825-a5e2-a9e7-9036-b7ef3a1814fe@users.sourceforge.net> (raw)
From: Markus Elfring <elfring@users.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@users.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
reply other threads:[~2017-12-29 19:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a5e86825-a5e2-a9e7-9036-b7ef3a1814fe@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=arend.vanspriel@broadcom.com \
--cc=arnd@arndb.de \
--cc=drhunter95@gmail.com \
--cc=eyalr@ti.com \
--cc=franky.lin@broadcom.com \
--cc=garsilva@embeddedor.com \
--cc=johannes.berg@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sre@kernel.org \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox