From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB2CA471431 for ; Fri, 24 Jul 2026 22:33:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784932429; cv=none; b=kpsYVAsx8IQc2PLkB0DJ32SymLsz5r8lLaRY5NQRQVjCM6G02c3QcFBlc7SOJwBzYa1N7HMt2TPJETV/DcQ0eBh6eDRdFdy86D1Qso5kY58FeqJhrKQyNEUXYTS1M4ip5W3p/FqPivD8Ybe+NxIrn8o2xoNJWtwZu5avq2QGZDY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784932429; c=relaxed/simple; bh=CLBqC99BDn2MJ6qbf62WJUrtyTuLzUq7nLojwyyw2KY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fE0cy/2EsCpj1MKCHn4QLBXMG5MYG1N0k1nW5mCJRESqZsU9I4zRHovR5sBhYk1Apze2bEjKrqowGBRuCm+RLkXgSup1+C904sOk20OiW5LgLmB1pXo/4/R6iu75Id5ga5yRY0NnhoE2W0/bGbSFakDfyz1utx4Z+AA38EB+LYc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZhvfXwnQ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZhvfXwnQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B24E31F000E9; Fri, 24 Jul 2026 22:33:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784932428; bh=x5SLjYjGlkUmOBLlLeMwyak86cKmhH86brefOh2GTvA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZhvfXwnQTwrf/oGIq5Fojct7D6sFeNVEG5IP8kshIqQs03kq9GPQTgvxJlJdELgYe cr5ctHx7kr8gDEaatiuw4bKqjEDie3oOOdlY4ALydFnQ1dB/NCi3ddJctsVxqSzsEU fRi42GD/fueJy9qxp+TlQ0uwwzsHkAefXZwCJUwdk4r61o2sejDOdS0TKAvSOBxBpb 5QMT5/bsMaD2RyY4gi49dmK366m3gZEv+YZSXrIA2HKI6arsA4PGYMGeYkyNZ2f1HS iB/8sauxGmMIL/kONVOni3bKrar7dUzNumpbzgGmYLeuZe1NwfejWR7sZrDLy/8iki q+i5wuVSUB+Lg== From: srini@kernel.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Ekansh Gupta , stable@kernel.org, Dmitry Baryshkov , Jianping Li , Srinivas Kandagatla Subject: [PATCH 1/5] misc: fastrpc: Fix initial memory allocation for Audio PD memory pool Date: Fri, 24 Jul 2026 23:33:37 +0100 Message-ID: <20260724223342.629168-2-srini@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260724223342.629168-1-srini@kernel.org> References: <20260724223342.629168-1-srini@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Ekansh Gupta The initial buffer allocated for the Audio PD memory pool is never added to the pool because pageslen is set to 0. As a result, the buffer is not registered with Audio PD and is never used, causing a memory leak. Audio PD immediately falls back to allocating memory from the remote heap since the pool starts out empty. Fix this by setting pageslen to 1 so that the initially allocated buffer is correctly registered and becomes part of the Audio PD memory pool. Fixes: 0871561055e66 ("misc: fastrpc: Add support for audiopd") Cc: stable@kernel.org Reviewed-by: Dmitry Baryshkov Signed-off-by: Ekansh Gupta Signed-off-by: Jianping Li Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index f3a49384586d..4f01ebfa6f95 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1370,7 +1370,9 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl, err = PTR_ERR(name); goto err; } - + inbuf.client_id = fl->client_id; + inbuf.namelen = init.namelen; + inbuf.pageslen = 0; if (!fl->cctx->remote_heap) { err = fastrpc_remote_heap_alloc(fl, fl->sctx->dev, init.memlen, &fl->cctx->remote_heap); @@ -1393,12 +1395,10 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl, goto err_map; } scm_done = true; + inbuf.pageslen = 1; } } - inbuf.client_id = fl->client_id; - inbuf.namelen = init.namelen; - inbuf.pageslen = 0; fl->pd = USER_PD; args[0].ptr = (u64)(uintptr_t)&inbuf; -- 2.53.0