Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp501365pxx; Wed, 28 Oct 2020 09:45:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdOEiFumAqhvUhojtoqJf5Pc9JybTBCMMFUMxKSbbtQwd6gGOT+z/+17Nf4265qCM29Ni3 X-Received: by 2002:a05:6402:3056:: with SMTP id bu22mr3633259edb.252.1603903521448; Wed, 28 Oct 2020 09:45:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603903521; cv=none; d=google.com; s=arc-20160816; b=DWV1l8o3MkVVbJOS5t0xz3zpsLWHVntG1YH61xsPRGp9DrRwQW01ir/iEjktOUEKHL eGfkclVaxVfcVHpF4QQYPA2dtTiL9stVEz9QorteVlF7DhhQB/3+W6/K4yXdA3xxGIR4 vkOjO2HO+l8np2tJXzLXQOXpN9/ipfvfUaIsLLtulWMcDKcHGMSSFHQLnVPKxukSSCOG cCmAIZJdOokxbhzDFkcXmcGaJVQKO5dAkqcrTIwdPt2fgqBRKyTsmgoO7/0VwyYc6DMt ut8kEVV+7lu1u9fsmLwZ5akG4tiype17/MwnFsZjGef08r1V660CHHgYMjqG4XqZkaLA r+nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OuI8QNk7lEAqVn1tk4Sp7W5PkwKFiffwkmNWSRE6mds=; b=FMsYwE50mpRE33jg11qSSIrCwvmVAcB5rjG1q8eXYDdSNYi5COkuhypCq2Xpvd95ue /iGiOkIKGT4ix8Ks7MGumVthYkKbuncD2u759YwwtNCpR3i6hKL64MdUDIj3COvgcuAY k0gJlGZLuE/gZCKU7yWWx3eMoL42+cisda6VTCvC1Ak2w2kBDu+8M+cs4ULRfkTPr7/M DutTNzEld6+Rh7/Qgix6Jk8JDO5fR+ZR9CUQKELjIzdue+N+kIOUbKCkIbEZ+WOZuy9c itCWr62tFRLcPh5qP5iZ9Xhm3bb/ZqmB91btvA7A07/McvbnMCjGkZdZsKQbrqVSnUet i1bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sbKDjuh+; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i5si3856525ejx.656.2020.10.28.09.44.59; Wed, 28 Oct 2020 09:45:21 -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=sbKDjuh+; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1818334AbgJ0RTF (ORCPT + 99 others); Tue, 27 Oct 2020 13:19:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:55720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752555AbgJ0OzR (ORCPT ); Tue, 27 Oct 2020 10:55:17 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 3655A22264; Tue, 27 Oct 2020 14:55:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810513; bh=9zdCY9c7iz9oLBb/F1UUlS3imeGH2+G6jyBTrmD0UIE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sbKDjuh+98qK6uDpV+fLK0d0LIgVl6dH8bZDzrS66cIF6+rBlBievg6EbWr5T0dmZ enh2CG1pFj2YGLTEOISGJeIua8LHhqYnsmHgg2AKuBwDsgETQkcETVQIV4CcjDN5eB OB36togAUHimSHf3UhywooaMKhKKI9rfsFsKK2hQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rohit kumar , Srinivas Kandagatla , Mark Brown , Sasha Levin Subject: [PATCH 5.8 165/633] ASoC: qcom: lpass-platform: fix memory leak Date: Tue, 27 Oct 2020 14:48:28 +0100 Message-Id: <20201027135530.407297293@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rohit kumar [ Upstream commit 5fd188215d4eb52703600d8986b22311099a5940 ] lpass_pcm_data is never freed. Free it in close ops to avoid memory leak. Fixes: 022d00ee0b55 ("ASoC: lpass-platform: Fix broken pcm data usage") Signed-off-by: Rohit kumar Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/1597402388-14112-5-git-send-email-rohitkr@codeaurora.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/qcom/lpass-platform.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c index 34f7fd1bab1cf..693839deebfe8 100644 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@ -61,7 +61,7 @@ static int lpass_platform_pcmops_open(struct snd_soc_component *component, int ret, dma_ch, dir = substream->stream; struct lpass_pcm_data *data; - data = devm_kzalloc(soc_runtime->dev, sizeof(*data), GFP_KERNEL); + data = kzalloc(sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; @@ -118,6 +118,7 @@ static int lpass_platform_pcmops_close(struct snd_soc_component *component, if (v->free_dma_channel) v->free_dma_channel(drvdata, data->dma_ch); + kfree(data); return 0; } -- 2.25.1