From patchwork Mon May 22 06:14:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9739629 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 15C2B6034C for ; Mon, 22 May 2017 06:15:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02A18286DB for ; Mon, 22 May 2017 06:15:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5906286DD; Mon, 22 May 2017 06:15:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73621286DB for ; Mon, 22 May 2017 06:15:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752088AbdEVGOx (ORCPT ); Mon, 22 May 2017 02:14:53 -0400 Received: from mout.web.de ([212.227.15.14]:50703 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751425AbdEVGOv (ORCPT ); Mon, 22 May 2017 02:14:51 -0400 Received: from [192.168.1.2] ([78.49.33.162]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M6V2p-1e9lTn2jkJ-00yNiM; Mon, 22 May 2017 08:14:40 +0200 Subject: [PATCH 2/2] ieee802154: ca8210: Delete an error message for a failed memory allocation in ca8210_skb_rx() From: SF Markus Elfring To: linuxdev@cascoda.com, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, Alexander Aring , Harry Morris , Stefan Schmidt Cc: LKML , kernel-janitors@vger.kernel.org References: <55fddbc7-28c4-8866-67d3-ff1ff1a4eeb7@users.sourceforge.net> Message-ID: Date: Mon, 22 May 2017 08:14:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <55fddbc7-28c4-8866-67d3-ff1ff1a4eeb7@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:8SNqna2vS+bECEIl0lbWRCBP9yck5ESrmW2PdsU2YLPQm+zSDkH IituTo/hR3/hJ7xjRkHhPpANk9DU7pH48P8LqCsDsICtnWDXojymnSMZc3OMe9SqjGFrgrL oFPw5uV5IboF/nAj8ci2UyBPgezmaSGpWVmH1SSsAKOKlgq9DfwNMANsbC6pwpGn9TwuS0j 3AHA+avAgInecU89PDGZQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:i+XiX8y37h8=:gILEOrLB+xSOPCst+XHSjO /HxZF/0ogJO4CWHO0fT3lhXENtjhAYIf1ucMu2APnBPZGZ2lQc8Ct+xwkBga8DjF+Cq+6z63E xz4YzdMLHHh0EqAlhJGBMAyzS0JlPIJQbL/mMcztJQyVsT8EazuKSQksL2832/RUsQ8EoKWrP QSl0X1zSwJ8JWOiLsP1DRF3tYSsadI4N0mdwZuRIZSs3t85/72EbJSAtc0s29stHmzXLyNmHE G6si0xG3UX3nVtFUhWhBVI7fJIXWOWmckyNXrTBK5NRLaPxRCCoPFxwspD1aBcprm/UxLlBPi scXsI4iFEHZCAYnZKpEMmRjMgnT0xcqPj7nas354ixy3iokqFHxm05u10M05SluXicgjx0GBI NMIstX2bmcfa6vlA2E+TRtKkRPZ1QZ1K69UqdYuFeK4xjpIqv1bA9oakyt9mOH/ayjUQ4vdn1 WqqLv1wVJzPp14j5sx7AqauAnX2qTqNZhrTLQqZgYbVgVRQWe985Oi+R5F2ZvmCi2XAcygd8h Ug85IJR+/OCncV6RuoRT/RbvP1FUflXupEOj/W0kEzt6gVhmIBO3ipfaSeEiyMDC8UKMehcaz HG1zJ6SIy3dWJ0YEkwfwg8F9dDrhmTp+ek1YX5CREBzEBRooF7zUrZhpB8qS1lfCre6V6QIdq swOV2j3e6CAEHxLFA1KxCMrKze/n34Bi7+C62BPLU+p2mET5Uu137KdLe2WP4is1juYvB+jLa iuqvvrkea/lb3202gwX00015LYA1hdWg9wN0w7VARiMA6Uzaj2Yb3ax/jtlXRWukbbJFTdfz+ PenEcu5 Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring 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 --- 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 */