From patchwork Sat Dec 30 19:30:03 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: 10137899 X-Patchwork-Delegate: kvalo@adurom.com 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 04767605B4 for ; Sat, 30 Dec 2017 19:30:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAD18285BE for ; Sat, 30 Dec 2017 19:30:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0E72285E1; Sat, 30 Dec 2017 19:30:57 +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=unavailable 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 88CD6285E8 for ; Sat, 30 Dec 2017 19:30:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750984AbdL3Taj (ORCPT ); Sat, 30 Dec 2017 14:30:39 -0500 Received: from mout.web.de ([212.227.17.11]:54818 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750891AbdL3Tah (ORCPT ); Sat, 30 Dec 2017 14:30:37 -0500 Received: from [192.168.1.3] ([92.227.102.199]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LnjBT-1f97Ir2Ox5-00hzJf; Sat, 30 Dec 2017 20:30:18 +0100 To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Arvind Yadav , Colin Ian King , "David S. Miller" , David Windsor , Elena Reshetova , Hans Liljestrand , Johannes Berg , Kalle Valo , Maksim Salau , Tobias Klauser From: SF Markus Elfring Subject: [PATCH] orinoco: Delete an error message for a failed memory allocation in three functions Cc: LKML , kernel-janitors@vger.kernel.org Message-ID: Date: Sat, 30 Dec 2017 20:30:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:uNCwHKjot4u+1RpuZuSxlY1kRF4WVjExIqyLaGmbTVzjiGI4YN1 fx9oaPsulQucswuU2pXG7clQ2AvLCrPBeGbLvqsKjD8qSq0ZQlbZkVIzfgiCfadH+4d2aXy cEl3YYzT3QB1myEG7aBFfmQuYaqXNYIbhc87RnJSpX2mufMPnPyHrazllyETh8gMIKzvFyu HIq3FmXHIG0dvSxXJSUlg== X-UI-Out-Filterresults: notjunk:1; V01:K0:uBuhtLYvn9o=:8yRG0KnOQKTijzjrHmWf1E JonaG5/5ZmG/aWcKi5RibcIbQoQgL2bhUKGmRzQwEUkDtfuAeCC+sESGMYtTnXvWfZnSoM5yM 3dn3iS0YB+9SfNwkd0EmAaaDoN3MhYwuZEoqEsnJkcL1dSdhNoSHH4ewSPgNTn5UveuLMbUvm oPfwnkMpv1Lpqv8tFcd8kfuz9btn3qKngm8vdcQZ0JGkuT5yRO+Xf0W+IvjigExhehlbnqqB8 6zX5ceAN2ck5wgRKDoqX6vZhM1aiEiYq1IRSpP+aMhvcdbl9nZx9hxja+dvDRzw1+RGvccjKQ xy14UkbQh0zjymlv33dFfEMgJNX3nNdWsrd7qkZgf/4zreFudYdM3OyYN7izBxQ4fRsIuYUcM a+GtbXrCEP2q1DMMMyGyyHt68aJxiz/JfBTInYzPx8+TXbqCrw4+MFg9D8L6bwTV7cAvlqr7p quMMax2o1FCK0tR0Ck9BnjvnLuREJ/zOIyItCASNBfClyiIndkzPIxySC4o6TfEhG224HlgMi pRVt8NirhrvWIAocez/JeMk1NSue2/h4N83u2UQSGBDRtYi1sIpsTVKcBA5+CXiNcreVnbUs7 jwFcUy5E0XWjVGsyXQpULRpKhbX6g1ytqgh87YlWkF1bvEHWsm2vwiJapodP6huLRn7l26JSM J77HpuPOkoPTpeSLGTeZKI4BdjtPbFmvxS7A/4xGmOeYODwDpd/lVz4OVMhHXTr48GJiDbN77 sL2YBSYCoa8IWKa/D+lK6KHKjMjfEDodmX3LfTbnI/pEFJAhGKNPXl1er4KpunLjp6uAe4bkj LrjFCbC2uTOQzQS8QwYQvzShnQ+SKvVq0gP4jsWyn12eEMOijc= Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 30 Dec 2017 20:20:56 +0100 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/net/wireless/intersil/orinoco/main.c | 10 ++-------- drivers/net/wireless/intersil/orinoco/orinoco_usb.c | 5 ++--- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/intersil/orinoco/main.c b/drivers/net/wireless/intersil/orinoco/main.c index 28dac36d7c4c..0b214f92a503 100644 --- a/drivers/net/wireless/intersil/orinoco/main.c +++ b/drivers/net/wireless/intersil/orinoco/main.c @@ -785,11 +785,8 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid, } skb = dev_alloc_skb(hdrlen + datalen); - if (!skb) { - printk(KERN_WARNING "%s: Cannot allocate skb for monitor frame\n", - dev->name); + if (!skb) goto update_stats; - } /* Copy the 802.11 header to the skb */ skb_put_data(skb, &(desc->frame_ctl), hdrlen); @@ -900,11 +897,8 @@ void __orinoco_ev_rx(struct net_device *dev, struct hermes *hw) packets from the card, which has an IO granularity of 16 bits */ skb = dev_alloc_skb(length + ETH_HLEN + 2 + 1); - if (!skb) { - printk(KERN_WARNING "%s: Can't allocate skb for Rx\n", - dev->name); + if (!skb) goto update_stats; - } /* We'll prepend the header, so reserve space for it. The worst case is no decapsulation, when 802.3 header is prepended and diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c index 501180584b4b..8ef96a1c231f 100644 --- a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c @@ -805,10 +805,9 @@ static int ezusb_firmware_download(struct ezusb_priv *upriv, int variant_offset; fw_buffer = kmalloc(FW_BUF_SIZE, GFP_KERNEL); - if (!fw_buffer) { - printk(KERN_ERR PFX "Out of memory for firmware buffer.\n"); + if (!fw_buffer) return -ENOMEM; - } + /* * This byte is 1 and should be replaced with 0. The offset is * 0x10AD in version 0.0.6. The byte in question should follow