From patchwork Tue Aug 14 10:57:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 10565357 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2A9D314E2 for ; Tue, 14 Aug 2018 10:58:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 140C428FE5 for ; Tue, 14 Aug 2018 10:58:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0699F28FF6; Tue, 14 Aug 2018 10:58:15 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13A0928FE5 for ; Tue, 14 Aug 2018 10:58:13 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id DF0AD26770B; Tue, 14 Aug 2018 12:58:11 +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 7CCA72677A8; Tue, 14 Aug 2018 12:58:09 +0200 (CEST) Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by alsa0.perex.cz (Postfix) with ESMTP id 3399F2676B4 for ; Tue, 14 Aug 2018 12:58:06 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.53,238,1531778400"; d="scan'208";a="342429575" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2018 12:58:06 +0200 Date: Tue, 14 Aug 2018 12:57:57 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Wu Zhigang Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, Liam Girdwood , Pan Xiuli , Ranjani Sridharan , Takashi Iwai , Mark Brown , kbuild-all@01.org, sof-ci-monitor@eclists.intel.com, Rander Wang , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] fix ifnullfree.cocci warnings 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: kbuild test robot NULL check before some freeing functions is not needed. Based on checkpatch warning "kfree(NULL) is safe this check is probably not required" and kfreeaddr.cocci by Julia Lawall. Generated by: scripts/coccinelle/free/ifnullfree.cocci Fixes: 0099cc17a399 ("ASoC:topology:avoid error log and oops during topology free.") Signed-off-by: kbuild test robot Signed-off-by: Julia Lawall --- Feel free to ignore this if the null test is useful in some way. topology.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -2165,8 +2165,7 @@ void snd_sof_free_topology(struct snd_so /* free sroute and its private data */ kfree(sroute->route->source); kfree(sroute->route->sink); - if (sroute->route->control) - kfree(sroute->route->control); + kfree(sroute->route->control); kfree(sroute->route); kfree(sroute->private); kfree(sroute);