Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp532973pxx; Wed, 28 Oct 2020 10:27:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjmUXkd0xopUfgzMRU2i/x8RfFipQE/VsF9HA9o6YDYWVsgeovXQXmZvUDUNi5ggGMXnOa X-Received: by 2002:a50:dec5:: with SMTP id d5mr9158310edl.362.1603906052887; Wed, 28 Oct 2020 10:27:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603906052; cv=none; d=google.com; s=arc-20160816; b=c7lUxhhrvKt1u3kek6MsHVmj5rfJ7/HYSH9nrpguQAXBuzH89RIAkP4QpaZauOzMev lAzDObgkVnbxKiNRl6jxAzuLBE0tKDMNvBpzZKR0Cog2yuRAq1OStInWmpft+DNys06J tq8e5COot8vcnlhUD+lB45cma6pupxOwa+Hvojpdp0RRHOyc4ITkux4Uvd2TU34X+e6T G1eAvTXq3BbK1YUnTEQKKURMrqDb6QHAgGJSUjRfubv7yPtxIOC3YRxwNH3PxHySU0ds vRwsLOTyHZF03YmJ+TXowSxPUdBXtI1Pr9FM1PYqYgfAepSbPly3kmeThUWw9Ym3csWK 6cTw== 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=WJKuq0hUtwz1/4QFiAwnPwSJkOXyxCsSSuuhKJawjIw=; b=tCyvQ3qKGKVzVYMhZZc5wYIuv3dToL//ounlFZzavhIKH56gIBaU0FGnZtBdjPFBW4 C/ec+jg8rSfKKkX8E8Iw2wO7fLcm11tiMbckT7mML3s2SJezp5ilxnnyuXa1XM/SkNTH DKo2HlXUlrQ0qpOziOhYvO9zJmvG85SQNz6zq588usN2ghL8iNPzAa61+PRxSAI8Vnn7 rEoV7DWrS9n0UBOJnsDlpYbPio3LlYJ+g447PVEgq3QI3ZJqcOgoLLJBu0Q9D6w4d0Jf q8M+0SYd367fO/hyDQdxtE0iTOHGJ76PcyQvvsRcLkGUHx4s/u+DSgRIF0A4deVat4Qr hfSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tU1w5LFY; 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 ay1si32292edb.3.2020.10.28.10.27.10; Wed, 28 Oct 2020 10:27:32 -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=tU1w5LFY; 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 S1821278AbgJ0Rlu (ORCPT + 99 others); Tue, 27 Oct 2020 13:41:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:60392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2898091AbgJ0Od0 (ORCPT ); Tue, 27 Oct 2020 10:33:26 -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 2801920709; Tue, 27 Oct 2020 14:33:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809205; bh=DbQPZHaN06Ws6Rf/bnkW5ta7iVxzrEVs1f4tTEIOwic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tU1w5LFYr8HV2drsttrs2HlN5bV8NYbeb46sZVbc7eV1YSgrySQHfpNuv/T/5cWqC f3Uz5G7jZvetjUKRNzVXCiTjYNz5zX6sDw3NTFCTCfZ/IlYUcpCZq1fkll6WajzCMm 33KijrmmGtu8h2ScNBXectPVmm5tfwqNTzIutUA8= 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.4 112/408] ASoC: qcom: lpass-platform: fix memory leak Date: Tue, 27 Oct 2020 14:50:50 +0100 Message-Id: <20201027135500.293236743@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 4c745baa39f73..9acaef81dd74c 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_pcm_substream *substream) 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; @@ -119,6 +119,7 @@ static int lpass_platform_pcmops_close(struct snd_pcm_substream *substream) if (v->free_dma_channel) v->free_dma_channel(drvdata, data->dma_ch); + kfree(data); return 0; } -- 2.25.1