From: SF Markus Elfring <elfring@users.sourceforge.net>
To: devel@driverdev.osuosl.org, Bhumika Goyal <bhumirks@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jay Vosburgh <jay.vosburgh@canonical.com>,
Julia Lawall <julia.lawall@lip6.fr>,
Mihaela Muraru <mihaela.muraru21@gmail.com>,
Mike Kofron <mpkofron@gmail.com>,
Philippe Reynes <tremyfr@gmail.com>,
Stephen Hemminger <stephen@networkplumber.org>,
Tobias Klauser <tklauser@distanz.ch>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>
Subject: [PATCH] staging: netlogic: Delete an error message for a failed memory allocation in xlr_config_spil
Date: Wed, 17 May 2017 17:14:09 +0000 [thread overview]
Message-ID: <de9c7ee7-564a-c941-37bf-ae2d1a339dfa@users.sourceforge.net> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 17 May 2017 19:01:10 +0200
Omit an extra message for a memory allocation failure in this function.
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/staging/netlogic/xlr_net.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c
index 781ef623233e..864304eb5f36 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -420,10 +420,8 @@ static void *xlr_config_spill(struct xlr_net_priv *priv, int reg_start_0,
base = priv->base_addr;
spill_size = size;
spill = kmalloc(spill_size + SMP_CACHE_BYTES, GFP_ATOMIC);
- if (!spill) {
- pr_err("Unable to allocate memory for spill area!\n");
+ if (!spill)
return ZERO_SIZE_PTR;
- }
spill = PTR_ALIGN(spill, SMP_CACHE_BYTES);
phys_addr = virt_to_phys(spill);
--
2.13.0
next reply other threads:[~2017-05-17 17:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-17 17:14 SF Markus Elfring [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-08-26 16:54 [PATCH] staging: netlogic: Delete an error message for a failed memory allocation in xlr_config_spil SF Markus Elfring
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=de9c7ee7-564a-c941-37bf-ae2d1a339dfa@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=bhumirks@gmail.com \
--cc=davem@davemloft.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jay.vosburgh@canonical.com \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mihaela.muraru21@gmail.com \
--cc=mpkofron@gmail.com \
--cc=stephen@networkplumber.org \
--cc=tklauser@distanz.ch \
--cc=tremyfr@gmail.com \
--cc=wsa@the-dreams.de \
/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