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 3E7DC3B4417; Mon, 17 Aug 2026 13:58:53 +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=1786975135; cv=none; b=TSJC6OkHuzqVA1k4WTU3uiwOjUAGvItGHZ/SwJIwW77tFeNvY+A1bpj0vDbXKRYK6+JsJNQYDgw7cSsxdIEgGSg8eC7x2PEB0hbUrGhmCafUN2E1khy6aNHmi3/WWu0NtNI/MidwBVDTW03kqBVlXRhAXSKpt+dC6wTN/vWedFw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786975135; c=relaxed/simple; bh=P5yfCtb1kXo0pCpGlZ545sJPr2j6F85y+s+zT/nATNk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=giovay6A80LirLxukxXrhpL7AshzVKM4WbzxUswggQ7tiNvjMeu9XEyGo7TFJ5/4Kjp9yz765MasjOYKo5HrNZgW+5hpkW0RoZe4FRC8orlbz8oXsy6XnwLO3rdZRegtQ8sdsIUTlzUZ87CdORc/+2ENneNkBMBYy+T8RYuF/mM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CRPOmldI; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CRPOmldI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46A821F000E9; Mon, 17 Aug 2026 13:58:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786975133; bh=I7Mev9LqXE7IuBUMzkxK+VAfzmkJkaZV0fsJQJUBr3c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CRPOmldIjDCBTFEZfSsPN5D3c60Omb3K5gcY5TJ3tT+Pemf46o3nbW2aOHo8sKXBx 9ql1tZAykPtbJmCN61Ynx43RbvJmte48pgNa3jfYp1o2IF81WvtIS+ruM+FWWWof1a yAJU/tea+Q3ODlRwX+J1//90QKLhpPZxp9UlLZ6Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable@kernel.org, Dmitry Baryshkov , Ekansh Gupta , Jianping Li , Srinivas Kandagatla Subject: [PATCH 6.18 174/250] misc: fastrpc: Fix initial memory allocation for Audio PD memory pool Date: Mon, 17 Aug 2026 15:32:15 +0200 Message-ID: <20260817132543.724997081@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817132536.466235697@linuxfoundation.org> References: <20260817132536.466235697@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ekansh Gupta commit ab99eaafb0c4b412cfeb895a8cf091626e2bbd86 upstream. 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 Link: https://patch.msgid.link/20260724223342.629168-2-srini@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/misc/fastrpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1341,7 +1341,9 @@ static int fastrpc_init_create_static_pr 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); @@ -1362,12 +1364,10 @@ static int fastrpc_init_create_static_pr 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;