Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752476AbeACPJY (ORCPT + 1 other); Wed, 3 Jan 2018 10:09:24 -0500 Received: from mout.web.de ([212.227.17.12]:64323 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751458AbeACPJW (ORCPT ); Wed, 3 Jan 2018 10:09:22 -0500 To: netdev@vger.kernel.org, "David S. Miller" , "Gustavo A. R. Silva" Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] net: plip: Delete an error message for a failed memory allocation in plip_receive_packet() Message-ID: <0beaf692-5639-f52a-d592-f8a157fe1e19@users.sourceforge.net> Date: Wed, 3 Jan 2018 16:08:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:a0BqNosIBCOduj5HaXzvhB2wVpaD9H4VLz81VEStHIsPNiDPOY+ nfZA994RcNF9i3ktRsBSoyBhgVu8/Yb34bA6JtTEZkGWgUcio4OGD8eLW046Fbdzb4iS0Lr xcyxM9025x/duMDSWMDy0UGXSCEfpr6SVc2tdtJWWQl4mWowz8Z3eUalTfRk2Av7dVjJM/s 8wCVn7ANxe1cQ3anAIx5Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:gLrtsI21WIc=:c/tPMWXC7awjkDUteUEUF7 vQ1O2wmzGQlwDPeVQ/IQs8kUwsX5BUApq85ROI5D3r2yZcsQbegMaZsAW7IkZ4DmeNRTGyHXc /QZhUhO5w4n9YVNCUYeGC1NiWfGSowHquyOoHQd0SVLYy+JG5j0JEBpNbynGid7obr4iIwg1i CMkxZ65lT2MVxg4yJfzHkQMAtakFCy/q1VymX2r3bgycStZ5CXfsfiFf7SwrO7WO3Cv67koMU 82fDYXt1fANr/39APiYakFbJaOsJwleyAxAQENgHtu+y49jPeppP4r3cuyTRui8dCFbQMc2Yf z8BG+iG6cIBPxtIsvFSwpUWmv1uhM6tOem37MQC2PzTcjjO8cBOc56eUknwCJGpvXKDQsHNoO bCTDvJHfnfiQBAtwR3GGe5Iob4DQHI3COC+Osd9h87HIZQbsX+JDUwpnTKtdBA78Ye35X6El+ +yDPhM0Y3T00ELtRl3FYyrj7IFNDYWRRZhyqGgf//OfRkQwfKphhbO3lSq202H7xkc3vytgrh 1f2xL0MutMWcFhyl5/xeGqUuiuIGnAgs8EKtxIw5B9PKB1DgUlAWjTohYk5t3o0xBGyZ5HB4D Hf5qEjyrP7XdWN9QxuZxdcZ3jyA/MDt2rdJirhl0LmSwn3UriuvEdYBdUxV8lDjh5S6ztoeTe 17N2lP70LRcCPm8MegOhir+er6mpcQb/8J2z6Q2c2nc0LtSyj1407+B+g39WYBWbhFTNLTOjL mPmm8NS/w9uAJym/l9ES1pXJqNQjjbKoYGDIMCE89M0w/2DE0BCBa+Huliiv2CxTJ22S8FYhs Zm4jv+2U8hE3AbHOOUObhlVHqKBzIhMClnkY3qVwS/qkgVpPjA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring 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 --- 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