Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4282066ooa; Tue, 14 Aug 2018 03:59:49 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwyO1+mC0bZ7HeMaW0yp4E/TVCNw9o6OvY0nuqWoSXMSAuCuDYGlN6DWztG2dfMKhDiRoUL X-Received: by 2002:a63:f043:: with SMTP id s3-v6mr19669377pgj.94.1534244389335; Tue, 14 Aug 2018 03:59:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534244389; cv=none; d=google.com; s=arc-20160816; b=mC60s5th01+yTOZIWOnzT3nqJKoSzwfctiUmbBluu8gQK0+O4SHRAdF5F0SqJUo1BK +UPs4QNWGYigwkK4ipmxqSOd88Hj5yL/BUF9Q3AgWwrRdubVrG/FQG1ywSMKgj73ipCH 09hUNCpmPUdBy920qboTj3jr2O8uJqegW1epXXeldWrnlckaXxJzlkf6L3cePdqaa0Or Ci9U7zwr5+2r3IHB14+VwvCm2dZej3sBRz7TrVEKAXXFZ+EU0AtQLTUd2yTf8xcxYJbY M2glVJU2D8NRarAlhmuXdMvsmlROFXoZOkbBn4Jxk3ICfBL85fKoYgYTPuVs0HNzO5Ec zhkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :subject:cc:to:from:date:arc-authentication-results; bh=iGInM/AFVcY8SE1eSbktqXnsHZF2jGyKcWBEuHryFeM=; b=l1vlh6+roOTOi4sRZ7GOmS8wfQCie/pfGLRoyfEhtHzwSfSkRr5Or8M/Apa9LdsW5+ Vs35C4ys2BtJdYpihzoa+2G55KK/zNZFSXmCFma1xu5KTRB6Pv+zpNryQTByw7dtNPSt d3qH17URLCK3MJNrRNCn9oZrnjTvAdC6l7w6CPBR4euL4OxP/F+uILCnVI6sanfwcL21 GM2m0Qr6Fp06xAKLVkdZ8Z8JdMAVeqWG2hRCXooN9jjkfjPZhWhxdHvzzbcCivU/meIA wJZ1/2UQKylGle8GltXPfE4bgItuX1/1vcnkzMJJ5KzdWeCbV8IeHGD+g43JC1EytzY3 6ejQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y141-v6si22699267pfb.331.2018.08.14.03.59.34; Tue, 14 Aug 2018 03:59:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731029AbeHNNor (ORCPT + 99 others); Tue, 14 Aug 2018 09:44:47 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:62619 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727858AbeHNNor (ORCPT ); Tue, 14 Aug 2018 09:44:47 -0400 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 cc: kbuild-all@01.org, sof-ci-monitor@eclists.intel.com, Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Ranjani Sridharan , Rander Wang , Pan Xiuli , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] fix ifnullfree.cocci warnings Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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);