From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C9A1C4363A for ; Tue, 27 Oct 2020 17:19:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE71920809 for ; Tue, 27 Oct 2020 17:19:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603819148; bh=9zdCY9c7iz9oLBb/F1UUlS3imeGH2+G6jyBTrmD0UIE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xjEsnZlumJpjwfEEeteAlnXAeeW1Hn7Em/jGvJT//vofthaYaIxnujEVrXkKz7nAy MMCF+xrengewC5Kds+RlwdGa06KJ9CtPjtj/1pBD9S4ZThrHz2TaBp2f0NM8VN8f7d YyI//evcgpb2EBPDnTnN5g1/eqS72c9wipfYWghU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1811717AbgJ0RTH (ORCPT ); Tue, 27 Oct 2020 13:19:07 -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