From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 662C4360EFF for ; Tue, 9 Jun 2026 02:59:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780973995; cv=none; b=iVsmZEY90huRhAvkBfTozMZ9sPrOmm5a3R1KUEMWTySGDMYZcoBQyRhnVtgTjC+OiP6qtzls8w3qlWQ+NQ39uTbZRE88ByakvSCLkuXobXkvr3fLQgDP2+gaQSlSAqnUuuqYdXSOrA+1pLwLh4kz/Y/+YD2LSR2O3CyXUeHCwe8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780973995; c=relaxed/simple; bh=4ulHOYGeyAaC+y+8rxA9T8W7h0nJpUcBKdMft56n4jE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PLOdMzS1WrCMqDugC9jVph8G5Wc/q7Qv0sBJKczQYLLQZ1LO6GF/mbFH0Jp2aufGx2RyU/iwjvtC2AYmDBUjvJ1UQSuM8B3qvS/tFUYLYH2vBSpmnPefDsteBFcGNIrs0Ga8DWNDjyoigydMkc/JdsZrxQKuFq7ztF/BU22I5G8= 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=dGE99MM/; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ZWj5uHEy; arc=none smtp.client-ip=205.220.180.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="dGE99MM/"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ZWj5uHEy" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6590s4wa995988 for ; Tue, 9 Jun 2026 02:59:53 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=IJDGglN97rh Rw4+XmxNVKbWIstzQQy65lHqMCInbHtI=; b=dGE99MM/oChVybdXdmUi7Nz0qDk 90aaTHO3oDtMpnhajzqDa5znAJXJBHqZKr0UdoSmeXJ0rQGzkaOJ5rC9kVJZfaEV xn8HY21OVj0Eeq12oKe+cgtSZOr3t/WoJZAr5bLekqMIJEo5yrwlI9h4fk3jBvOV B/GxHST5SJNu3tWY02gBB+6BLMu8ZVlUwFxRiXOnah776zhsQNxwwJMTe2tEiZwG Soz6y6xlr0cudwaFtT0pAYLy/BY8OD2q1TaqCmUur/QFfoEXK87cPGgxgTTjqxJB SV2AivpCZoqN6dIIQoEoCvjf4k+8tKZVto6CJQWlncUfV4hMmPhboNoNUUg== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4enx2rudy9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 09 Jun 2026 02:59:53 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-36b982ec338so5869116a91.0 for ; Mon, 08 Jun 2026 19:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780973992; x=1781578792; 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=IJDGglN97rhRw4+XmxNVKbWIstzQQy65lHqMCInbHtI=; b=ZWj5uHEyo6fx2I3ZuzplF83yvd9cqxu9FUV66ZYrJgWtBUqrbQ6XHwrzpIeVPyUFcH NOX6OYB0FfMEuBfHOrUk81nebz7soQkaay6j4dxbfsxTKNIa1hNhao7NEd0eGo0+mblp xog4zCTXJvJujXqd9srMsxgfgp+nBYSOOi2/Iu1hyYoVPg5bSQmLCTDmXjs/1qJXB9zM GsJj4kSXLYpGeDamWv9ynuG55HwPaPc3HFwH/g5c9OGYrwUW/p2rlGJtj0W+KyIfn2gG wNdBsb5+npi5rRVWRsxi78s5Ae+A+5nAuAOsVqS2sWuD58FNuo8CeTGWsEsa1OR2CVeC 90hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780973992; x=1781578792; 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=IJDGglN97rhRw4+XmxNVKbWIstzQQy65lHqMCInbHtI=; b=mE0hEUiaNsuflYwCuy4i9FOs+1LeQ9rbbrAec08wI4R4ebrA/498sTGRGf5QN8uhJo QnE56v5PW/g6meXs0FxwKXSSM0MaQ1tPc+/+LIwuBeLOhHHREDfPWds9rRzui1xKmFsf rrCnrJ1qXRLEYh7Wqoj3Wkf+7Z0gxuhbWeusgpfHYfF6uOqNya0HgP6WOuvHHjONzMtB 1stANNrIj1pOq2G6fPu/yQMOQRPJqzqPW8UKarlV2TLZn0gWlU+RKZn6YO00pPW9B3kX HhSZWb2hT0i2D+s+3t9LHMlgObTXh9bE/iVoZu4hFnE9ofUex1J3c0LQYIMJ6PN1TzaA JSpA== X-Forwarded-Encrypted: i=1; AFNElJ+mpXglcvME6zfP40hCCZUSokDpXoYIkR+BcDfLKqMnXtPCsEIyn4ftJlkJ2GvD1AjVNez5Q6I6bUSBp8g=@vger.kernel.org X-Gm-Message-State: AOJu0YxwMGG4vdKQSPZTG1A+A34PyBOOcHzUZizmYnkcuCNXnP+D3o+D QdxX0b+y1uMHEc+4EV+ZA80BLc0EKCHoWpaHF9F8TY0TCLiLVDRs0Vd0koDQjWLqFQBHyXkXv2f 168ThSk7+SUGpnAdzYxLiRR51sR1XgGmEy39g4bDpTkeNK+0wOKJhXaNSfYSni4R/P0Y= X-Gm-Gg: Acq92OFjTSZpanWmD6t/WTSfg2dggo/dSOfEnmKwYHLReZQ/5KKU+H/zJmBDFa78uzI dErERWkDtZRliFo4PFJ1tj2ct1FgD9PvsynTzzNK+B73i3uF9/sF04NNJqCDsQ7+mNgXYQ9upB8 LU1P35USf/qPAxHB4AB4GFZ9zQlVJwpjwkV1bsauai4+vLI3oiHBHLh4Z+mzIBdy+SBeJYTTOT9 o+02ktfcryns0/QnM6AxTfJ04Wj/h6PZA+CxI9Vg6CQvMYRgC2dm7vRp1eFSJ2xgUX2kW6M+Gve hxiwtcH6t5Vmol8VA06vDWZfyPFCYuVwfU9Khmw8KQb8CL7aoLYslv5wyI92lUd0f6Mjkzovwk6 0dr/ksfMh7EUAkYvI4AdqSoMlYQ8jwLnYgqomX+aFZHRy/b5l4VV5BwFbr8HuFAjjmn2MeTBCTb gGTIZ2WfpGz0/OHfuoqtpnf5wk+BMm X-Received: by 2002:a17:90b:1801:b0:36b:bbee:fb28 with SMTP id 98e67ed59e1d1-370ee33d0bcmr19282619a91.2.1780973992236; Mon, 08 Jun 2026 19:59:52 -0700 (PDT) X-Received: by 2002:a17:90b:1801:b0:36b:bbee:fb28 with SMTP id 98e67ed59e1d1-370ee33d0bcmr19282595a91.2.1780973991684; Mon, 08 Jun 2026 19:59:51 -0700 (PDT) Received: from QCOM-SocCW5bzXR.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3712fcb2607sm8713835a91.0.2026.06.08.19.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 19:59:51 -0700 (PDT) From: Jianping Li To: Srinivas Kandagatla , Amol Maheshwari Cc: Ekansh Gupta , Arnd Bergmann , Greg Kroah-Hartman , Abel Vesa , Jorge Ramirez-Ortiz , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, quic_chennak@quicinc.com, stable@kernel.org, Dmitry Baryshkov , Jianping Li Subject: [PATCH v8 1/4] misc: fastrpc: Fix initial memory allocation for Audio PD memory pool Date: Tue, 9 Jun 2026 10:59:35 +0800 Message-Id: <20260609025938.457-2-jianping.li@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260609025938.457-1-jianping.li@oss.qualcomm.com> References: <20260609025938.457-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: 8bit X-Proofpoint-GUID: MpQix5AenkH3c6KDPdnZ-AqBGpH5NbyV X-Proofpoint-ORIG-GUID: MpQix5AenkH3c6KDPdnZ-AqBGpH5NbyV X-Authority-Analysis: v=2.4 cv=JdqMa0KV c=1 sm=1 tr=0 ts=6a2781a9 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=bIEaOLAPTWlh-3IGMggA:9 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjA5MDAyNSBTYWx0ZWRfX8O8R7vJlm7vz wmP1SxOViQdblhFvAHSpFN7aiTjj+SMm/Y/fn6hEqZB3g4Qg64NcLBU4R91U93Wuu5Nvp0wefDs JesP9QFae9qwHwzTeW+Zk9cbxzLz5N+RKvwUSMAqJLSLE/Uw87C8z9+WEyJdn/ZaqxhrdTT/fUs uZEjk3VSlBqoqflZaFYsgVoEvAlLXnwZ01obd4jHqE00UQno/f5Fy9b+JGDIraL71XppkqOpeEP oacPACMBa1qQtdFSdK+km6gzqDYtf4qdIXDjZSaUBt/hBq+WI2BbSrUAoA4dE5CXvXORswH7RRF GV8LyJaGCNaWzTzsNKhB26/MADJjOxuNGmk+p1GMwcb3pDpTShUtnytZh0e6Q1ddstX3jt3Os0K JNIR49D3gNTGPeZ2OAQlHXBGR9L4yr5KluPFUCfhK/k08N8qXL9c9jxj8pwcwTh6N26hkFmO9ma DigeMw1G1m39pNAqYGg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-08_06,2026-06-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 phishscore=0 adultscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606090025 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 --- 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 a9b2ae44c06f..96961217b856 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.43.0