Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4880265pjb; Mon, 27 Jul 2020 07:28:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDdh6XIlX0bTJrXU2kyTieYvGBq4cci9FOgPpeO031HZiR7lTH/cth9W5O+BIdmA7zfEzy X-Received: by 2002:a50:eac5:: with SMTP id u5mr22108909edp.6.1595860123730; Mon, 27 Jul 2020 07:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860123; cv=none; d=google.com; s=arc-20160816; b=Tk1HyEM/Ibf6FLMdlmm7ase05Wgakp4QIAQJq/Sh/q+nGGmIP4KKERPbkyX882arKO EfhEVxypy2oTwHxH+wA770JRGak72GXwk4p9ht1+1DeNAWAM0/hDqM3v63QhQuPeTAvy iL4qw0yCTZ2GBQxiEM/hw6xATaTZLP0/Yk3C+IW06alEcVJDWqKtZFwJID1oyd2z8lC4 VX9rVUpo7B5zJmYHz+l1Vjt9pGT9mPxxysMkU3D7LOPfeOez6MFC+bUXxRXM8HzscnUn GIiZYGS6L+vOdbtL5CU4ULaSC2whaCwpeecYZUbIe1gFFi1JxGzHb1TT7axxUN6tNoVG Oqtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6Dp6vqJZzRbD471g/z+kHk+blzz3fVTjsjcX4nQ1Jog=; b=BDnOaDD436f6qLF1COLfZj5GRON3aCPJjx2xqcgRhitFz+ESmnfJAuOgnKw+j/jYAo r2ZTOgL+PWWutC6t1DvYNrA/f9TBJxi8hGYp/MSyg4fBEVPwPHc6jR8E9FmR6Kax6lnG jLavSqR5PFsXyq7n6CgVLyJKEfPjTctXJ4FDEdrwnbhVflcrlJK0oJYTP65rm1eVSNIn uTocuRA4IczOBYpdfucGF1tJpLf/zZggoPgMGzTA/itcEdfVjD1Bitar8dJAxDAULrra EL3LQZvrWlHuYEkscLG803U/gfWsjq3oZNOtr4t7PJR2rkSVgXvBFJf4j3inCLPKnhhK U9bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S0pLL0wf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lz17si1452422ejb.521.2020.07.27.07.28.21; Mon, 27 Jul 2020 07:28:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S0pLL0wf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732569AbgG0O0T (ORCPT + 99 others); Mon, 27 Jul 2020 10:26:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:56392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732565AbgG0O0K (ORCPT ); Mon, 27 Jul 2020 10:26:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BF5ED20663; Mon, 27 Jul 2020 14:26:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859970; bh=m+cqJk/Uajl6vw/kWiB+Qzjbwq+4YqOUuVYyI4zk7Hk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S0pLL0wfk1w2q9PffGy3Y2s657Oqqi3nVTQ/QKN51Iih1g+BnbXrpq88781L4G5FT 9P3N9K5+AKPZ04fvPkPNLBuQtYjM+IBjv4NEtqRnjaorRnr1kt02JJnISdTLFdODEi 1MOwQB8RsLaQPkCtlkDomvSo57TpA2ov7wxcvlCU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pierre-Louis Bossart , Ranjani Sridharan , Kai Vehmanen , Mark Brown Subject: [PATCH 5.7 175/179] ASoC: topology: fix tlvs in error handling for widget_dmixer Date: Mon, 27 Jul 2020 16:05:50 +0200 Message-Id: <20200727134941.181158722@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart commit 8edac489e7c3fce44208373bb3e7b5835a672c66 upstream. we need to free all allocated tlvs, not just the one allocated in the loop before releasing kcontrols - other the tlvs references will leak. Fixes: 9f90af3a995298 ('ASoC: topology: Consolidate and fix asoc_tplg_dapm_widget_*_create flow') Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200707203749.113883-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/soc-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1395,7 +1395,6 @@ static struct snd_kcontrol_new *soc_tplg if (err < 0) { dev_err(tplg->dev, "ASoC: failed to init %s\n", mc->hdr.name); - soc_tplg_free_tlv(tplg, &kc[i]); goto err_sm; } } @@ -1403,6 +1402,7 @@ static struct snd_kcontrol_new *soc_tplg err_sm: for (; i >= 0; i--) { + soc_tplg_free_tlv(tplg, &kc[i]); sm = (struct soc_mixer_control *)kc[i].private_value; kfree(sm); kfree(kc[i].name);