From: Peng Li Date: Thu, 17 Jun 2021 14:03:18 +0000 (+0800) Subject: net: hdlc_ppp: remove unnecessary out of memory message X-Git-Tag: io_uring-5.14-2021-07-09~10^2~132^2~1 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=ee58a3c7c6bbabb0bf3685a8b437b5d4be33890c;p=linux-block.git net: hdlc_ppp: remove unnecessary out of memory message This patch removes unnecessary out of memory message, to fix the following checkpatch.pl warning: "WARNING: Possible unnecessary 'out of memory' message" Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller --- diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c index fb5102c1afc6..aec9cc4d5b48 100644 --- a/drivers/net/wan/hdlc_ppp.c +++ b/drivers/net/wan/hdlc_ppp.c @@ -219,10 +219,9 @@ static void ppp_tx_cp(struct net_device *dev, u16 pid, u8 code, skb = dev_alloc_skb(sizeof(struct hdlc_header) + sizeof(struct cp_header) + magic_len + len); - if (!skb) { - netdev_warn(dev, "out of memory in ppp_tx_cp()\n"); + if (!skb) return; - } + skb_reserve(skb, sizeof(struct hdlc_header)); cp = skb_put(skb, sizeof(struct cp_header));