From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linuxdev@cascoda.com, linux-wpan@vger.kernel.org,
netdev@vger.kernel.org, Alexander Aring <aar@pengutronix.de>,
Harry Morris <h.morris@cascoda.com>,
Stefan Schmidt <stefan@osg.samsung.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/2] ieee802154: ca8210: Delete an error message for a failed memory allocation in ca8210_skb_rx()
Date: Mon, 22 May 2017 08:14:38 +0200 [thread overview]
Message-ID: <a0c71307-4777-fd52-9f4c-cafd0f4d43a0@users.sourceforge.net> (raw)
In-Reply-To: <55fddbc7-28c4-8866-67d3-ff1ff1a4eeb7@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 22 May 2017 08:03:17 +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/net/ieee802154/ca8210.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index 25ed11bb5ed3..f6df75e80a60 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -1808,10 +1808,9 @@ static int ca8210_skb_rx(
/* Allocate mtu size buffer for every rx packet */
skb = dev_alloc_skb(IEEE802154_MTU + sizeof(hdr));
- if (!skb) {
- dev_crit(&priv->spi->dev, "dev_alloc_skb failed\n");
+ if (!skb)
return -ENOMEM;
- }
+
skb_reserve(skb, sizeof(hdr));
msdulen = data_ind[22]; /* msdu_length */
--
2.13.0
next prev parent reply other threads:[~2017-05-22 6:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-22 6:12 [PATCH 0/2] ieee802154: ca8210: Adjustments for two function implementations SF Markus Elfring
2017-05-22 6:13 ` [PATCH 1/2] ieee802154: ca8210: Delete an error message for a failed memory allocation in ca8210_probe() SF Markus Elfring
2017-05-22 6:14 ` SF Markus Elfring [this message]
2017-05-22 8:28 ` [PATCH 0/2] ieee802154: ca8210: Adjustments for two function implementations Marcel Holtmann
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=a0c71307-4777-fd52-9f4c-cafd0f4d43a0@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=aar@pengutronix.de \
--cc=h.morris@cascoda.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=linuxdev@cascoda.com \
--cc=netdev@vger.kernel.org \
--cc=stefan@osg.samsung.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;
as well as URLs for NNTP newsgroup(s).