From patchwork Sat Dec 30 19:57:15 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: 10137905 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 D52966020A for ; Sat, 30 Dec 2017 19:58:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C76E62873F for ; Sat, 30 Dec 2017 19:58:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA75128783; Sat, 30 Dec 2017 19:58:27 +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 738A12873F for ; Sat, 30 Dec 2017 19:58:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751015AbdL3T6F (ORCPT ); Sat, 30 Dec 2017 14:58:05 -0500 Received: from mout.web.de ([212.227.17.12]:58224 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750968AbdL3T6E (ORCPT ); Sat, 30 Dec 2017 14:58:04 -0500 Received: from [192.168.1.3] ([92.227.102.199]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LqDYi-1f8qoS3ero-00dm8I; Sat, 30 Dec 2017 20:57:29 +0100 To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Al Viro , David Howells , "David S. Miller" , "Gustavo A. R. Silva" , Ingo Molnar , Johannes Berg , Kalle Valo From: SF Markus Elfring Subject: [PATCH] wireless: airo: Delete an error message for a failed memory allocation in airo_networks_allocate() Cc: LKML , kernel-janitors@vger.kernel.org Message-ID: <33444ac1-9a8b-bd7d-fd22-f299add190df@users.sourceforge.net> Date: Sat, 30 Dec 2017 20:57:15 +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:lNIv+fBZ0Gk0mUCyQjQl3OWleNdLG9tIzHMJz3P8s8a2G2SOmdY 8j66MvXfWEJL/9L/aqN9R9bMlmq+vVXLhNxuxNfUy5o6QrXSilO40cIJzLMM1axN2nognV8 Ivkny3VwlfBXPCbLtFb+Nt7tH9S4er4uiYTPrAAV+ZWYDjQRbf/2Mw1YKkS47cO0JmakJhN hyZrr+4R+pg5auudBmXNw== X-UI-Out-Filterresults: notjunk:1; V01:K0:yUZ7R3ltXYM=:Z46SLOQUuu7uim9rnAc9G5 x0X3c6DXhY1xvKTsE3PXq60MAECpqTAWRFQwV8kePlcFbCGR7qHOuGqGoLW+Dl++07LJol1V9 teANxz9U6C4UkyC9xcDGyuVO1fublXD2ZC6bw59UgX2Ckz09JL2CVVY+rm9GaQKFqdeSJVWik hXamoAo9zM9TA+rp9Z9yVaw1fw9vczyd60wv+/JI5jyJs5TPWLUb9nKaEneG4O+Ws7Mp0NQ/u lccO9sWJw+s0HNdViDicLsTWjos7Tw29ODAO4EJp9FSKuEETIQH3ZthAqbdOBw8nODZx4hN2T t3ETRXAAMiGAT+gbpZmnBs3ron15lUAr6RSzFyaq2pcoxdKZp9txvwukU1UMUWptq1d/sRh+c X8k51lObOFV/9pFqW8+7UmikJNmHkgQTc5+yVTm4Rl5uCKKpphweIPdwIXoZ4rzR+w7bqcHAk 33rFbPs1DNZyp3A3Ty+J0YOfj42OUXyZlIB+5mxBZQ43utBNGq9/mgWgwTzuvL5gOBHSkKdlS v4DoZoHLh8CBYgCmhg2V+8P2G6YJVrxa/Z1PyJcCeN7TXZMhQ5YaJclVhQSAQNXekADPAGiJz XH+8gdIBOlXLhE0It5JnD2nuEQtOJr9QMRgRukea6f/FsoISuzFXQUBRpayappMvV+iCcFMvc 9NM4MIpWbGi+lbhrjKSRkwvsMeFQ+KLlBwXs1M1KN0IDx6MJf4x0BlsD882W9noHRp3R3zZtz qoom5+qPVhs+kw9ExXISKTp+JEv7Z/DZAFdwGdltx/xFC2GHQdEVKKO7Eh7vqnR9nJ+lt+pHk gMWhqT5eorUUVTjGDDZ5H67AMQ18x5ith9QOsd44TBa1RN75C0= 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:48:44 +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/wireless/cisco/airo.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/net/wireless/cisco/airo.c b/drivers/net/wireless/cisco/airo.c index 86e795de6760..a65d82d26eaa 100644 --- a/drivers/net/wireless/cisco/airo.c +++ b/drivers/net/wireless/cisco/airo.c @@ -2714,12 +2714,7 @@ static int airo_networks_allocate(struct airo_info *ai) ai->networks = kcalloc(AIRO_MAX_NETWORK_COUNT, sizeof(BSSListElement), GFP_KERNEL); - if (!ai->networks) { - airo_print_warn("", "Out of memory allocating beacons"); - return -ENOMEM; - } - - return 0; + return ai->networks ? 0 : -ENOMEM; } static void airo_networks_free(struct airo_info *ai)