From patchwork Wed Jul 8 19:31:57 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: 6750831 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7A754C05AC for ; Wed, 8 Jul 2015 19:32:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ADAE720665 for ; Wed, 8 Jul 2015 19:32:20 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 223C8205FF for ; Wed, 8 Jul 2015 19:32:18 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id AD625265A9A; Wed, 8 Jul 2015 21:32:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id D8256265A2B; Wed, 8 Jul 2015 21:32:13 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 79699265A72; Wed, 8 Jul 2015 21:32:12 +0200 (CEST) Received: from mout.web.de (mout.web.de [212.227.15.3]) by alsa0.perex.cz (Postfix) with ESMTP id 651E826512B for ; Wed, 8 Jul 2015 21:32:05 +0200 (CEST) Received: from [192.168.1.2] ([77.181.59.179]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0M57ja-1YoDS30Z1K-00zFuV; Wed, 08 Jul 2015 21:32:01 +0200 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> To: Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org From: SF Markus Elfring X-Enigmail-Draft-Status: N1110 Message-ID: <559D7AAD.8020500@users.sourceforge.net> Date: Wed, 8 Jul 2015 21:31:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:U36ATZrINzMVmTNRwHzscp5MFmIaftJcpY7HjxFAxUWhuzXO1LU bQpdxl7q6ZsFitLzvXMb3IHlcndYJg3DW+SbEoVfKN41O0PMSNp5LJSrGB4CglahqPCQbo2 9RLX50qHBmDjNq9DfPUklcnGSuxlCtg/ApA2TaUxLLMkqkgT2Vx0daxujGySg48L3rHW2FA qaZUAzEkfVwpk41PR4WHQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:Pt+QFgqbz94=:wJAEW3MgE+8/BjPbMFb5Hn 9S6fv2nBBYjVr7YtbPVlui7fPULloCaRTnLCZA47mnR/62WCHhZkp97Cf3sxfHK7Dl5S4Wg4m OgWZQ2ekqE4g2sgP2iIFyKe9Gj2/dF8ZK0lOGA/x9Z01jGQEQFv++9FnhOgsI2qAT2vmq0Egg R2lw3FAs7OKUAVtAvzbUPjjWuvpQVf6cbpBvggx1YmOec8yUSP1qh+rjqGz/bKANiA9G4OiTe zC+/9m7HgMN6JicQc8NFTPkWqcQHZQElX2aAbdvaqO3dSFduutCaeP/1gYVDMwekk8jV1DJww wyNHrJsF4iQ8Y6LSi0HNyuwhKdkYVecdhn936p9kfSmcAtlUcCreEBogot8nYoh2ixRljCean uo4lEuLMlWV19DBtJV6cGfvLcJkkl0dKikqK3Dxho6U5pwEm9ewVuIHU28JZ3ykuSkbt1ArjJ QHgj/YZtPnWoP8twGRCTBSFtPOszPEWy8DyP07m+w0Y/IFExXS64d+omL83oW2hjg0DZScjL2 6K3PUW4fY4ew/ClZ+RNx5POcUZu5ezOq9WqR/MCr/2yYoxbttKQm1gXDAE6yyAHOmOtvXxWdX rfMGRzvzDIrQXcOQZS5XBsH3NezfWAN1sI+SLwwB/ZF5Ecvkubf1BZZ7iVTwppRjK1ZnGu6vD /5MATtCCe+BZSVoq1TM7103U16GkRVes2rxqOFrQ3q7BrO4avN5n3UxN+W2ixxGw3q+w= Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH] ALSA: hda: Delete an unnecessary check before the function call "kobject_put" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 8 Jul 2015 21:26:02 +0200 The kobject_put() 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 --- sound/hda/hdac_sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/hda/hdac_sysfs.c b/sound/hda/hdac_sysfs.c index 0a6ce3b..089b35f 100644 --- a/sound/hda/hdac_sysfs.c +++ b/sound/hda/hdac_sysfs.c @@ -321,8 +321,7 @@ static void widget_tree_free(struct hdac_device *codec) free_widget_node(*p, &widget_node_group); kfree(tree->nodes); } - if (tree->root) - kobject_put(tree->root); + kobject_put(tree->root); kfree(tree); codec->widgets = NULL; }