Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1646541
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/2] ieee802154: ca8210: Delete an error message for a failed memory allocation in ca8210_skb_rx() |
| Date | 2017-05-22 08:20 +0200 |
| Message-ID | <tJORb-1PK-5@gated-at.bofh.it> (permalink) |
| References | <tJORb-1PK-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/2] ieee802154: ca8210: Adjustments for two function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-22 08:20 +0200 [PATCH 2/2] ieee802154: ca8210: Delete an error message for a failed memory allocation in ca8210_skb_rx() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-22 08:20 +0200 [PATCH 1/2] ieee802154: ca8210: Delete an error message for a failed memory allocation in ca8210_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-22 08:20 +0200 Re: [PATCH 0/2] ieee802154: ca8210: Adjustments for two function implementations Marcel Holtmann <marcel@holtmann.org> - 2017-05-22 10:30 +0200
csiph-web