From patchwork Fri Dec 29 19:50:54 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: 10137355 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 506976020A for ; Fri, 29 Dec 2017 19:51:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 482D82E0D3 for ; Fri, 29 Dec 2017 19:51:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C6292E0D6; Fri, 29 Dec 2017 19:51:41 +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 EEED12E0D3 for ; Fri, 29 Dec 2017 19:51:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751808AbdL2Tv0 (ORCPT ); Fri, 29 Dec 2017 14:51:26 -0500 Received: from mout.web.de ([212.227.15.14]:63774 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751412AbdL2TvY (ORCPT ); Fri, 29 Dec 2017 14:51:24 -0500 Received: from [192.168.1.3] ([92.227.72.214]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LtoGb-1euXsC3BWH-011B2t; Fri, 29 Dec 2017 20:50:57 +0100 To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Arend Van Spriel , Arnd Bergmann , Eyal Reizer , Franky Lin , "Gustavo A. R. Silva" , Iain Hunter , Johannes Berg , Kalle Valo , Sebastian Reichel , Tony Lindgren From: SF Markus Elfring Subject: [PATCH] wlcore: Delete an error message for a failed memory allocation in three functions Cc: LKML , kernel-janitors@vger.kernel.org Message-ID: Date: Fri, 29 Dec 2017 20:50:54 +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:N2hLKTyuD4Efvy2ZCeIYUoJCxH571ubvAhkv5Wy4YdIggHpb8gc fo+yYKXg4kVcadCKRDKLYVlnAR1nt+57jMtu5lNlx6pHFITOg+Kg3iVq6CXnmUq6g/RENQq frTGW+jIJIyoFiIbDzUOp+PZMf4G5GXYPNttCtJ7ylo27FJ53Xc2Hj+MFejfkj6vl6ol6zy 8quYKPHEogjBEGjAbPiow== X-UI-Out-Filterresults: notjunk:1; V01:K0:PAZx61+7b/Y=:feyGuahFwa4k6y6Fmu6VXT 0t7l7jM6FUgd1JoqdVj/iCVs0HGoydMc8OETPyAzCUqGtPkRloo/rdGbhNqkYFTnTUpiyD79e GArX6PYbl9nn+cfwNZbVJidWmpLoKVgCjHTy/B6r2uycAF6ZuF6mcTHhlHSajGsQubyCT4WkX 0JhRTMxaTqbjdlyOjnc4EJYKujPO2800V1BG3MyfsNkH15vfdptXlVc/N0JTUN4k2r7KjgyP9 sNym+KxyekF4+Vkj6iDDaDwwJJRyPFXl6Vlg9MiG/EVUVbkxPhFe8BTXbhMKS5I4DSF2PO+zJ 5fpyafUHCZmoQkdLks2uAPEJsc6+e6/McpdHcgw3AI/Q1jqhWdl1PHKNkq+7dsKU+BKLyx0Rg pnxVdvwLtRZuwW2eXd8j6sgMl1LNzxzct2+Io7SL6yKIpiwtlz0413/3T3GL9oLkTuQp7GGQl 56L0/pXjiZTpcPCoUshUMcrbxG1qNyyGzS14m8ep4QvraBBXs+ZhDEBxme+/ekGc6Zr+UB+uE kJqrNLof5qQ+/6X5NdpAuX1UxIlHPb7Iku1WOZZzW+/qIXBhA64AhuQJps8BbUIGmBbob6vnr 9La2nP3463sph35/ZMXpflj9SpTaL/F1VL7t/uNVGN+XT0bl1duwhkqWA3vaMCZ62rHH8lvK/ R8cLY5dBUj3VR8B28x/5RpEHZfU82VoeKOBPYUtwKOLWGaX4oPHziX7hrgUgz8TeR/YHNNnrS Wwaz6LwjD9asRVOn/LXU6BZ882hQ1bbn5OWyelnOdaeDC/TT99pYbv64vDSytgH7NiaFjDlmW aFsA6WnJATW4+bCpD8R7+pOsNZEBrWnNjCB9nAwae8HCUpmf6Y= 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: Fri, 29 Dec 2017 20:40:49 +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/ti/wlcore/main.c | 8 ++------ drivers/net/wireless/ti/wlcore/spi.c | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index c346c021b999..970e59871547 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -1301,10 +1301,8 @@ static struct sk_buff *wl12xx_alloc_dummy_packet(struct wl1271 *wl) sizeof(struct wl1271_tx_hw_descr) - sizeof(*hdr); skb = dev_alloc_skb(TOTAL_TX_DUMMY_PACKET_SIZE); - if (!skb) { - wl1271_warning("Failed to allocate a dummy packet skb"); + if (!skb) return NULL; - } skb_reserve(skb, sizeof(struct wl1271_tx_hw_descr)); @@ -1421,10 +1419,8 @@ int wl1271_rx_filter_alloc_field(struct wl12xx_rx_filter *filter, field = &filter->fields[filter->num_fields]; field->pattern = kzalloc(len, GFP_KERNEL); - if (!field->pattern) { - wl1271_warning("Failed to allocate RX filter pattern"); + if (!field->pattern) return -ENOMEM; - } filter->num_fields++; diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c index 62ce54a949e9..fc94a0d1a01d 100644 --- a/drivers/net/wireless/ti/wlcore/spi.c +++ b/drivers/net/wireless/ti/wlcore/spi.c @@ -489,10 +489,8 @@ static int wl1271_probe(struct spi_device *spi) pdev_data->if_ops = &spi_ops; glue = devm_kzalloc(&spi->dev, sizeof(*glue), GFP_KERNEL); - if (!glue) { - dev_err(&spi->dev, "can't allocate glue\n"); + if (!glue) return -ENOMEM; - } glue->dev = &spi->dev;