* [PATCH] net: plip: Delete an error message for a failed memory allocation in plip_receive_packet()
@ 2018-01-03 15:08 SF Markus Elfring
0 siblings, 0 replies; only message in thread
From: SF Markus Elfring @ 2018-01-03 15:08 UTC (permalink / raw)
To: netdev, David S. Miller, Gustavo A. R. Silva; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 3 Jan 2018 16:00:23 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/plip/plip.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/plip/plip.c b/drivers/net/plip/plip.c
index feb92ecd1880..22f10d395d9c 100644
--- a/drivers/net/plip/plip.c
+++ b/drivers/net/plip/plip.c
@@ -632,10 +632,9 @@ plip_receive_packet(struct net_device *dev, struct net_local *nl,
}
/* Malloc up new buffer. */
rcv->skb = dev_alloc_skb(rcv->length.h + 2);
- if (rcv->skb == NULL) {
- printk(KERN_ERR "%s: Memory squeeze.\n", dev->name);
+ if (!rcv->skb)
return ERROR;
- }
+
skb_reserve(rcv->skb, 2); /* Align IP on 16 byte boundaries */
skb_put(rcv->skb,rcv->length.h);
rcv->skb->dev = dev;
--
2.15.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-01-03 15:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-03 15:08 [PATCH] net: plip: Delete an error message for a failed memory allocation in plip_receive_packet() SF Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox