From nobody Mon Feb 9 19:26:49 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 AE3E933506A for ; Thu, 15 Jan 2026 08:29:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768465792; cv=none; b=d1cE9k4tKrt0RxLt6aoTkGtwfQb3ctKVMQj6rBBOglKnPiJB1k6VyJC7r90QlVpGQg69W56M0+ccySOjr7Ueh5g1+HjXazR9TS/P+epMP+U6U7VjKdj7OKJZuITPg1S/YDXd+BO29Tu4aqkM2SksGaWHBNZDht96hAerqRqvM0Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768465792; c=relaxed/simple; bh=kFYArw6kA3ak0O+0DSJcTc6oRpn6IstRIU9gS8rLTCc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=r4ku35hzjq7HGQrxtZWP3rAaUwbKGK7mYcuhSKyaHWSFRq3H0JSMv/gLkgrvqVMmBQvnezJ0HxOErHCnAI1LsRvhoXJEEisyG3ok5VeEF4kX3yqLmXiK3vacihvZXns3k54E020OlrEa0j+qYbkjmnYSP15m24mHAGNaeZgmzDo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Q7K9OY9L; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Kly9Irkp; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Q7K9OY9L"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Kly9Irkp" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60F6fh9H1581843 for ; Thu, 15 Jan 2026 08:29:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=gjM0kaavbOL Ce1K3pLI5wzYI8dV9tn4xiVQbvJTgorA=; b=Q7K9OY9LXLBfPW2UdgGJqwWByaT tUOaOgB+54qFJ3fnanp5m8+lSTn+zP31zBW18qwyb57/vmUheE3sQr+0N413IEti F15QCJ210ELt5ug3bt1u00kkMhcB4Ija5l9N74t0Vr+FcNngJYwCVCYWXVO3DFdF yq+cJg4aXA8GP16cvGZtR200bJlodB98ZwWreYjqqSDJWMvzC2Y0ZgcjAmdOYvAN m1LzFj7X26khhLhMNzvqlZe/VLzkwOPeVZP1gSbmGW7N8HuqY/1eFJzMQa/LcM8c r2uQWqqrlkeTwsq1aOrzKqOEw24X2orFJUF91PebyfjnGP+7w8GboHuFe6g== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bpj1pst3m-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 15 Jan 2026 08:29:41 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-c552d1f9eafso1224282a12.0 for ; Thu, 15 Jan 2026 00:29:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768465781; x=1769070581; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gjM0kaavbOLCe1K3pLI5wzYI8dV9tn4xiVQbvJTgorA=; b=Kly9Irkpd38nu+1kFNyzMhD+aW3zyG16ewIpVyQ9eQWmkchnjsJvI4YFtRAaipNGr0 Zq2uRH/IKx2xlhagnExv6wNAz56nJdmgyROVQaEH/YkMdh0nD1cBHtVE/yhGfmdRrbh8 /ryl5l+PHwMrtvDqOPyVg40Y+TaCCB6ZfVidxWae33i3qomEuM5SX26VsfZ31U05n0tb n/kUqBcD/XaBrdGr7KoCHGx3LiMZ1mb6/O9I9FL5N+ODLscpoS5qA+TQEvaeLFMjwBxa hV5eVO7Hox2KnSHGSZW3CJocdr0C+OwFtaGTKwD82Yo1pMO4WMKOKAm5TT1g5yD3xqpK voUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768465781; x=1769070581; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=gjM0kaavbOLCe1K3pLI5wzYI8dV9tn4xiVQbvJTgorA=; b=U5m0xe3NR59WyGOpOhGLe8lrquzONL/c27R7SknL7HUKkYexKF74u0fJfdU/bgRIQv 5jRybDHVvmkBwRxmT9lCVcr/HT15JTUqDMKYoF5Y2OPWMjJ9rhyaLN4kPTwt+lpSTYOQ 4BMoys5fYco2lNEAUMafL2z+osptQtO5Bms6CnbJNsNQCaKmy1TJU/Mioj5OKQWXr1ll KfsGeTKy0qvJdbhFBcHJP4Fvn2SIi3jlEF97IFV56k1HL09NT4rY90wThm6iLjuYoUtt Gkgn09j+yT5L+LYQvDuIH+vG8wqY6KikdyKcp/hK//IBxFkZ/Hm3BuBjyFhqjuZTappF w2WQ== X-Forwarded-Encrypted: i=1; AJvYcCUqvNVQiS95yjmiVzx7XvBqIoMgKRqlxAF4B6z32dIBL7RkqMxn8sjkpY9UPUZg67Hxoh77IC1kVcjH2BA=@vger.kernel.org X-Gm-Message-State: AOJu0YzceRHhF+of7a9fMd1+JIq+/dDw24JAtLczQi37gMV4X5y8ElB6 CbKLCv9k6rgCUlqiYBPdk1UJZYEUfIji6yB4apmKxTWimVRRTrBZaHm68XJv+XcX4iPcZ0SyPMQ SW3BZYKfNRRdmKb+Vz67D65p2lkmqylSTCINlD8wxC3+lP9/4Lb/y154JcmGnKB3vLLg= X-Gm-Gg: AY/fxX5UxCpzVitQZIan6V7MI9SkIM2sUtG3l2Tr4Il1AU43/xlxyK833UGhmISk37M EfZ8DGqLtXsaCbkofnDQ6XtwY90J1uIbv10Ci6i4Cp+j1shMWV0OJdbjMcrzEwxHKLB+NCARAjt ziFbHj1WLn3HjB7DstIyjgXlbKsy6Em097SBVnUUyKy6CIp6vcTQcWAJlWq9YKGIAd1p8e2usQB Ed+LIHAHQjjA8Uu+uoOu8PBGNy+BhfzHJ9k74I8gqOhFwWJH4Qw7VWN682wRNhM+Ve48/w+mpP/ dnrDwfGvfmqeuU2lFU4ZySLEgpEf0vyfNryXsfULT9c9R/V/pcWqpqJv8JUhG2piuOtwv3ST4g2 4TYnCDKznZxxcrL+GcBV+ygwvR0kyac4qgj5TcyYU X-Received: by 2002:a05:6a00:1d0a:b0:81f:1610:709a with SMTP id d2e1a72fcca58-81f81ce46f9mr4520958b3a.5.1768465780917; Thu, 15 Jan 2026 00:29:40 -0800 (PST) X-Received: by 2002:a05:6a00:1d0a:b0:81f:1610:709a with SMTP id d2e1a72fcca58-81f81ce46f9mr4520930b3a.5.1768465780354; Thu, 15 Jan 2026 00:29:40 -0800 (PST) Received: from QCOM-SocCW5bzXR.qualcomm.com ([202.46.23.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-81f8e69d1e7sm1773296b3a.58.2026.01.15.00.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jan 2026 00:29:40 -0800 (PST) From: Jianping Li To: srini@kernel.org, amahesh@qti.qualcomm.com, arnd@arndb.de, gregkh@linuxfoundation.org, linux-arm-msm@vger.kernel.org Cc: Ekansh Gupta , thierry.escande@linaro.org, abelvesa@kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, quic_chennak@quicinc.com, stable@kernel.org, Jianping Li Subject: [PATCH v2 2/4] misc: fastrpc: Fix initial memory allocation for Audio PD memory pool Date: Thu, 15 Jan 2026 16:28:49 +0800 Message-Id: <20260115082851.570-3-jianping.li@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260115082851.570-1-jianping.li@oss.qualcomm.com> References: <20260115082851.570-1-jianping.li@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE1MDA1NyBTYWx0ZWRfXxO1cbmPZ1fAW AbzeztimOovPdzIzQMxJgFyRVfpSnG+oJH1GGop0Fz5MEY8HlS3DVNpoIZePSMTPQQr00TysrJN cAujiW+CnZCCsLmnvAo3gmu9reyCke9bvjHeMatHdexmUrWYeMxxoQjODH51LGLgosCX+mzjdi2 M3gH1bNucVfRKO/vRPFybxdlhnkS8gU5ZSVZJ33ioO2kjd63hJJNCuAWbzBQEkiVPfVJd08i9AC k0ycOTi5XIzmtkxq5tdbd30DXTJec+gn09X22DsGrZGW7Mz9smrrKE9JYrGDrQ0rHjmqxixVJuf OTWWW/C9jrOFLv0rYWZix/7bozI7ipbWlJsm7CfUnL7YQCWNIwoGuS+l9x0LMq9DCDCu7sqI+6f dl6c6r4Kq1Km8WCr7KlYzFyPdFSCdAuvQIGeblkMVuFXSkW0pk0Q5L86wzRMzGEbBtMDXfJh0uP NO0WL/eMQ7vctxD70eA== X-Authority-Analysis: v=2.4 cv=J+KnLQnS c=1 sm=1 tr=0 ts=6968a575 cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=j4ogTh8yFefVWWEFDRgCtg==:17 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=Op9FgWJ_R3wbKKMAuNAA:9 a=_Vgx9l1VpLgwpw_dHYaR:22 X-Proofpoint-GUID: KofFLAZi9RTW6v8vuxWa9vJnPSqe1a1F X-Proofpoint-ORIG-GUID: KofFLAZi9RTW6v8vuxWa9vJnPSqe1a1F X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-15_02,2026-01-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 priorityscore=1501 bulkscore=0 phishscore=0 clxscore=1015 suspectscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2601150057 Content-Type: text/plain; charset="utf-8" From: Ekansh Gupta The initially allocated memory is not properly included in the pool, leading to potential issues with memory management. The issue is actually a memory leak because the initial memory is never used by Audio PD. It will immediately make a remote heap request as no memory is added to the pool initially. Set the number of pages to one to ensure that the initially allocated memory is correctly added to the Audio PD memory pool. Fixes: 0871561055e66 ("misc: fastrpc: Add support for audiopd") Cc: stable@kernel.org Co-developed-by: Ekansh Gupta Signed-off-by: Ekansh Gupta Signed-off-by: Jianping Li --- 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 515a43c9d95d..4f12fa5a05aa 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1328,7 +1328,9 @@ static int fastrpc_init_create_static_process(struct = fastrpc_user *fl, err =3D PTR_ERR(name); goto err; } - + inbuf.client_id =3D fl->client_id; + inbuf.namelen =3D init.namelen; + inbuf.pageslen =3D 0; if (!fl->cctx->remote_heap) { err =3D fastrpc_remote_heap_alloc(fl, fl->sctx->dev, init.memlen, &fl->cctx->remote_heap); @@ -1351,12 +1353,10 @@ static int fastrpc_init_create_static_process(struc= t fastrpc_user *fl, goto err_map; } scm_done =3D true; + inbuf.pageslen =3D 1; } } =20 - inbuf.client_id =3D fl->client_id; - inbuf.namelen =3D init.namelen; - inbuf.pageslen =3D 0; fl->pd =3D USER_PD; =20 args[0].ptr =3D (u64)(uintptr_t)&inbuf; --=20 2.43.0