From patchwork Tue May 8 04:47:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mukunda,Vijendar" X-Patchwork-Id: 10385365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BC8B3602C2 for ; Tue, 8 May 2018 04:46:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABFC028CA9 for ; Tue, 8 May 2018 04:46:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0D2628CBF; Tue, 8 May 2018 04:46:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EBBB28CA9 for ; Tue, 8 May 2018 04:46:49 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 845822676AB; Tue, 8 May 2018 06:46:48 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D47992676AB; Tue, 8 May 2018 06:46:46 +0200 (CEST) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0087.outbound.protection.outlook.com [104.47.32.87]) by alsa0.perex.cz (Postfix) with ESMTP id E1A70267646 for ; Tue, 8 May 2018 06:46:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=YJwVZA8bIe3VfmroZ3/JX/0YEAXgi+2tUOpbFGD/hi4=; b=Ssb8q7+kb+TEQEoz69znxZiipvLYEx/+/9SajLhjOya5occHr4WO+ltPDngDIZSd5E0FwM3jMXByVyejvvlNy5z/ZE3VUIuPfZMGJ/2SUt1ctcjkI96PhUD8M3Gt484JvKGQjJMYxfZgjWyBBwdSRh5AxRNibwJEmBR376prke8= Received: from CY1PR1201CA0033.namprd12.prod.outlook.com (2a01:111:e400:5b9a::43) by CY1PR12MB0758.namprd12.prod.outlook.com (2a01:111:e400:59d1::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.17; Tue, 8 May 2018 04:46:41 +0000 Received: from DM3NAM03FT016.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::201) by CY1PR1201CA0033.outlook.office365.com (2a01:111:e400:5b9a::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.735.16 via Frontend Transport; Tue, 8 May 2018 04:46:41 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; roeck-us.net; dkim=none (message not signed) header.d=none; roeck-us.net; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT016.mail.protection.outlook.com (10.152.82.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.735.16 via Frontend Transport; Tue, 8 May 2018 04:46:40 +0000 Received: from LinuxHost.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.382.0; Mon, 7 May 2018 23:46:39 -0500 From: Vijendar Mukunda To: Date: Tue, 8 May 2018 10:17:49 +0530 Message-ID: <1525754888-14124-6-git-send-email-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525754888-14124-1-git-send-email-Vijendar.Mukunda@amd.com> References: <1525754888-14124-1-git-send-email-Vijendar.Mukunda@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(39860400002)(346002)(39380400002)(396003)(2980300002)(428003)(189003)(199004)(8676002)(426003)(2616005)(126002)(53936002)(53416004)(11346002)(81166006)(39060400002)(446003)(109986005)(81156014)(68736007)(4326008)(5660300001)(26005)(1671002)(186003)(486006)(77096007)(8936002)(105586002)(50466002)(106466001)(48376002)(476003)(59450400001)(47776003)(336012)(104016004)(76176011)(86362001)(7696005)(97736004)(356003)(316002)(16586007)(478600001)(72206003)(6666003)(2906002)(36756003)(305945005)(54906003)(50226002)(51416003)(266003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0758; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT016; 1:cmf0jWjy4Kl0IfMDPdvKZEi9E9KyxTswZXSLmetXwlGmp0jn3oL1DVrPut2fRV86VhUcK/VxADoOzOZme5sYN7GrXcoXuVW0c8vSsVZ/SK4le/AbQSqaxYCSeLdg52P2 X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:CY1PR12MB0758; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0758; 3:fzf3DBaLu8jfGiEvjoxNZQQwFUPbrQYZkF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eaZ53buBMWfBm5fOUEIUN9li3+NLdxHJo+7MLb2pVNdslATsyn1x5ZLcvwCesQZCMQ0hqLG4xogQRS8QXHUD0rERN/Q8faQguizNguP5/fKbPPAe6ldrywFOw45HXmZtX3BJplPW/O7VE7KVFKTvMrXvLHOBm/eutAjx9zZ4VLi1Go4uxs8K4rvfKlXhqOYmbnmrAGF5Wow56A7VdAKr9F1ubuV34Hn5opP4UA5m0g6fjWjH9islTDrdwIOAe0bhtoN+f45RSIbtGqmPmIgTFdS2tuiHvfH3b8Fb6i7A3tCqX7duW6OzqI1IE5Wl7BVLAsqlgPyGO+GIiHoHhW0IXrj+BrFw209VVKw4US3x2Xyjf/0DcUfkH0LFW0leEhTfkaE6GuKhODJtq9pZJ/vC506rYHlF6oVVnQ7kIhZc9lzrBjwl8XK/sluib4u X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93003095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY1PR12MB0758; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0758; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0758; 4:/6jz+/3Az25sW/bh7pZhXZ7w4GZf3vzbPJdhDrOZWhY57wQqcII+26jKlLBIHfvYD9YKU0J+0e7JunCushA07SzbLxY181N5RaXIBZZu6p0f/wbON+WjQJe0FiQJ58ay6cqgFGUe6sdB3n8Bp4s8b90veXgSa5V8nkrVjOEbWj9s1DJGt24bazdaj4A7We2bEzLiRfujkOG6b2r8XOnb3U4UadKD9wUNoZ3VdCw0QyhG72tfeGbMdZng6mvXzqF3GpvI94MW9KGxBO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YsQ5HL/uKDLdqT48f9aWn/HoPVIQxuR1l0sJV1RDDcGDg36Fb7rvz57OUi72?= =?us-ascii?Q?PglEab69OTCI+M9gB5IfhAOBumPOJWES/e9dfaZV3UXN4B63w8ywpXqrhhpF?= =?us-ascii?Q?zVMZm7InZMEvPmArhO6Kkf76cTyzvzEKvplP8xs62YN5EZbt8NgB0j/n4mYa?= =?us-ascii?Q?LCiqanj63ShXKeZ9Lwi+nmOmV6yL473HsfzI+JINl/LwN3EXz7fDU+DFyhuX?= =?us-ascii?Q?3+GNVWm6WPoIdQcItEeXAQcP9emOWralbRdGriXZegu3ZtBzlwqb3cjkfiGX?= =?us-ascii?Q?01L/DWQUAR4k2fmxOepuIXH9JU/9Y2hOTp2HrCfoiraBCSkMM6+7u0In276u?= =?us-ascii?Q?pEtmwKpgYfAux/OrMuh4gsGzF1yFUgud7WBtMmVE/yVWRF4CmSXZuAupIUfh?= =?us-ascii?Q?mU1uln6E0IYx87Hz26D63SECf9iBmzlY4EGFc2JaSKl0zxGIGQU+dl9cCgL1?= =?us-ascii?Q?SUrCBTChRZ6EYqEWy8=3D?= X-Microsoft-Antispam-Message-Info: P7IabstZDja1Joqr6+FS3J3M7dQ+lE9G6e2a1gPDHVmXGB1e3JFHY20tg20pxgdtNSGDhrsXqqliCOgrE82sC0vv+1W1MdsJ+m2OiMMEsJHVQjWsd2PhejaudcH19PE9ZgeFndoMWEmwYb8jx6lvRikLZjPOhwG7fSL2mxEfgdi8tvo5xl3pRChw9uTBCbj7 X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0758; 6:eFF1FY0bSjAgwzBzugQW6OyuC1YsjflmKF530goxhYs2G1EeUNayxfCiWnfnBGSglmN6HZs0g/Il30MQyYt9/rZ7bp6Yw2D1bJ/bb3fEQbAs0THWwuMoO8krSix6GGic6qceEuCwUTaVaUy+RFT6Ti5Ag33CeceeqgMZphsca1wvB3GsatLTCKJXuyiwHPXkoiWiyfq8sFvCZHbSICKFs0826sUOVyr1S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iLp50VBV3zOyweWUu6ryu+Z8npvFxStqXM9BdZH X-MS-Office365-Filtering-Correlation-Id: 154c0d10-819f-43f7-4dff-08d5b49eb110 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2018 04:46:40.7355 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 154c0d10-819f-43f7-4dff-08d5b49eb110 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0758 Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Liam Girdwood , open list , Takashi Iwai , Daniel Kurtz , Mark Brown , Vijendar Mukunda , Alex Deucher , Akshu Agrawal , Guenter Roeck Subject: [alsa-devel] [PATCH 06/10] ASoC: amd: memory release for rtd structure X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP rtd structure freed early may result in kernel panic in dma close call back. moved releasing memory for rtd structure to the end of dma close callback. Signed-off-by: Vijendar Mukunda Reviewed-by: Daniel Kurtz --- sound/soc/amd/acp-pcm-dma.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 8236116..ec9cab3 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -998,8 +998,6 @@ static int acp_dma_close(struct snd_pcm_substream *substream) DRV_NAME); struct audio_drv_data *adata = dev_get_drvdata(component->dev); - kfree(rtd); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { adata->play_i2ssp_stream = NULL; /* @@ -1028,7 +1026,7 @@ static int acp_dma_close(struct snd_pcm_substream *substream) */ if (!adata->play_i2ssp_stream && !adata->capture_i2ssp_stream) acp_reg_write(0, adata->acp_mmio, mmACP_EXTERNAL_INTR_ENB); - + kfree(rtd); return 0; }