From patchwork Wed Feb 4 16:47:27 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: 5778181 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 18BCA9F269 for ; Wed, 4 Feb 2015 16:48:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 403D42024F for ; Wed, 4 Feb 2015 16:48:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6787E201EC for ; Wed, 4 Feb 2015 16:48:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966978AbbBDQrj (ORCPT ); Wed, 4 Feb 2015 11:47:39 -0500 Received: from mout.web.de ([212.227.15.4]:62888 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966331AbbBDQri (ORCPT ); Wed, 4 Feb 2015 11:47:38 -0500 Received: from [192.168.1.2] ([92.228.139.27]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0LqXBp-1Xfsg52qS9-00e2W6; Wed, 04 Feb 2015 17:47:28 +0100 Message-ID: <54D24D1F.50001@users.sourceforge.net> Date: Wed, 04 Feb 2015 17:47:27 +0100 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Kalle Valo , Solomon Peachy , netdev@vger.kernel.org, linux-wireless@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH 1/2] CW1200: Delete an unnecessary check before the function call "release_firmware" 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> <54D24CC3.9010006@users.sourceforge.net> In-Reply-To: <54D24CC3.9010006@users.sourceforge.net> X-Provags-ID: V03:K0:KZpwmwLXHNnzL0Lb6O4nps8keE8ySMmaQzBXd3mVqh3urYzLZWi MnOmwtED9Km2sy5tMFxTqwvrRtRWxCC0ZVLeEO/s3Qwb8+D/CSERY0oFt4DQgQgRMV4dDxy VVevDFT9Uy3xGkDUtLqV3n2wyYzpsZr3d1KZq5RhPx+PadIuCLepbtysSDz7mKZhi1OUFml 3JD9BJT7F/4VrfVvgFRYw== X-UI-Out-Filterresults: notjunk:1; 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: Wed, 4 Feb 2015 16:32:15 +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 --- drivers/net/wireless/cw1200/fwio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/cw1200/fwio.c b/drivers/net/wireless/cw1200/fwio.c index 6f1b9aa..581dfde 100644 --- a/drivers/net/wireless/cw1200/fwio.c +++ b/drivers/net/wireless/cw1200/fwio.c @@ -246,8 +246,7 @@ static int cw1200_load_firmware_cw1200(struct cw1200_common *priv) error: kfree(buf); - if (firmware) - release_firmware(firmware); + release_firmware(firmware); return ret; #undef APB_WRITE