From patchwork Fri Nov 6 07:58:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 7567271 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CBAA69F71A for ; Fri, 6 Nov 2015 07:59:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E9AF220612 for ; Fri, 6 Nov 2015 07:59:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1B5D8203AC for ; Fri, 6 Nov 2015 07:59:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032835AbbKFH6r (ORCPT ); Fri, 6 Nov 2015 02:58:47 -0500 Received: from mout.web.de ([212.227.17.11]:62921 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032528AbbKFH6o (ORCPT ); Fri, 6 Nov 2015 02:58:44 -0500 Received: from [192.168.1.2] ([78.49.86.198]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MUnUe-1Zve7w2HU4-00YAuI; Fri, 06 Nov 2015 08:58:32 +0100 Subject: [PATCH] net: brcm80211: Delete an unnecessary check before the function call "release_firmware" To: Arend van Spriel , Brett Rudley , "Franky (Zhenhui) Lin" , Hante Meuleman , Kalle Valo , brcm80211-dev-list@broadcom.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <546E0DC8.3050906@users.sourceforge.net> <546E2D2A.6090101@broadcom.com> From: SF Markus Elfring X-Enigmail-Draft-Status: N1110 Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Message-ID: <563C5DA2.3000005@users.sourceforge.net> Date: Fri, 6 Nov 2015 08:58:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <546E2D2A.6090101@broadcom.com> X-Provags-ID: V03:K0:2hhG1VWUzmO141isvSbC0z41yggMLL432IE7CagctoOoB1fBBR/ FkuJzLoH/r0soRxwi3gKLHaq8ZOktG7Q+CwVTujU20Io0VeLVO4SYl2Ivmxf9appWVGVWFe uZf6qvxBlljOovAlQVbyn6nyujlDnsiXMuDKzM3sbaGDgjHmcN/nDq3KXUklB7/Zm8Rl762 7ydwK3QXYA08Q66fneQSA== X-UI-Out-Filterresults: notjunk:1; V01:K0:E3MKd/MbQoA=:2Q+nIbnhXdyqazD63tNptb JgjLdEiE2nfVvVNFDE7sQ2XGuucfDZL73S0d2zwuslAkrDBoVtvuxX0/0ARadjY1HAsplzFsP t/Oh6gdmvD0bAicHIrjuSHu+c/nLpqqKNAxyFP2ILSgJNc977iFtUAjQNkEIA+wGyKddYvTcY ahoh+qB+EwuFxQ+gOjaM4JuA9yTUzkKRoPWfGO/5X78u0EQ4UiO0RDbLxJl27ITMmM9pkY18E Klh9X2Lx5oOyrCeDMkD76k/Os4d6rm4/PW1nCWBbzP6vbhjpTL+9zyM8c4yTXEid7KtsQ0kro n0Gk7RnX+PbjswpYijLV5c1RRqNc1ynhV700FhXA2XTbIvf7zT9jei2SlmKscdWf2pvej2NZM M8uSKybAa7oIrfENCdywB08gjSgXC3PLbgjlIx2AD5Ag8i4HZtmG51aU/sHwBHgwFFLd9oWFZ wK9SB0tKqv7KriEi4xHlN6oMb9dfOw4cbsr4ira1LtR2NLtGyZrMIsg/JY1L3MkHQunzeZtfs jvFx+QqmFcBV0KqSxe0hrnPb0Wsppetl2uwMl1jY1RxmD9qe/QLj3pEgkcn90gPKRa12D69Mw 5ZS5oAl0pFnTgukZiTVU7n59NOtOAGCCHeZCw/Hjz+PMwy6ETdf7XAPy/Z0Z94vQieUaNrYWP FHxpnamg4sBFlOyrVEvSOminigpmLA5YODx1bbLA0PM9rlW6cJK2FtRPxkptUBfNZsMemllFp drpADQQFmHd6PDJmfvNexvIZ+InvOgO3LIi2WZu4qcoSe0JBEvVAiOLwWyfRa2W2wWDl2esrZ v7hCf2e Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 6 Nov 2015 08:48:23 +0100 The release_firmware() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Acked-by: Arend van Spriel --- drivers/net/wireless/brcm80211/brcmfmac/firmware.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c index 4248f3c..33afb9a 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c @@ -449,8 +449,7 @@ static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx) if (raw_nvram) bcm47xx_nvram_release_contents(data); - if (fw) - release_firmware(fw); + release_firmware(fw); if (!nvram && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL)) goto fail;