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 980433F0A97 for ; Fri, 15 May 2026 12:42:38 +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=1778848959; cv=none; b=IjjnmK2dCjP2qFt8/P6OE9etA2BuHIU7nwI3ovlkFnIlCrkW4U5rm8rqJnrfVZWfSSPqZM8Ydsup9fzG+QswrpPtzEw4yn6bKmGpoxxyEB67HZ3lMyC16E2iaSDxN864NXD0aKQY1aszkJydwhIJD7EOsMzIO4wzN6zcT7pEwxI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778848959; c=relaxed/simple; bh=td9NUaJUCCqcs9shCrPz79nraSFW2hpmFyg3yX9KMf8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IC03y8Vx1YCJd6Z7AyJhekBHKj+Kj6aNSqIsq1B7uyQYDMR0aan2x3xaCL6s8eEtWBoRw7E/VvXR8/98y/K6j/mYdm0L7AxQ+6dDMDLzC5TYQFghGhw52NIerleMRkq40SFSoxridOfpvPGeU0GgWjWj/sWD2MGbk+2FlrSIGrI= 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=F4D8EOar; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=XTb+iYKf; 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="F4D8EOar"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="XTb+iYKf" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64FCGiUf3795642 for ; Fri, 15 May 2026 12:42:37 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=pqILH36+bPj XkI9bIGyaDvTximt2bkQbgl3RjerBI7A=; b=F4D8EOar1wz9Cj7mkw+2d9ACo/r ywk8pbZWNUkSxPQXUiCA7VcD33E6W9PKqAsnwyvOiUz5IdB8iM5O/hclhcV8xTsb lW15qLgY+BtYFYNVC0UYroc/N+DQuGXGpK1uT3K/8OU08kN8LgHNhbBj8cDMoQfi eBqjsg9ui7eCtdQQHZntGdl4DwaSzAvDFGsmPfA/OYT4CI/WDEIzgCAu+cFsWFqv JEWsbZIcBnAYVN0MnvA9khMG2Dv6Agylzz9m+lckFF8Qzj+mLXQEhrmrZFCTAycu DdtLBanQApIywH8p2rIahUBX8FlPsKtlxTh6VaVKxXSR2YoHlPkbeS/FxCA== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e5m1su76p-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 15 May 2026 12:42:37 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2b4654f9bb6so94390705ad.2 for ; Fri, 15 May 2026 05:42:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778848956; x=1779453756; 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=pqILH36+bPjXkI9bIGyaDvTximt2bkQbgl3RjerBI7A=; b=XTb+iYKfF0YA/6BoLRM3c41NIsWZsJzc9FXoZbaHVK1W7XOdO++6aBgl5qAESaBtZd SbOikF0AZDkwZLMZh1Y3WdWKNLdR+WmLly0emDPmXuBhJ5hK+etc133SmI7civRSTmo0 6IN3qbar/sDpOO4z4UUFxjgSRISMFzEHkwZpdo694sLPzb5t7eHRDGJVfWa3pFz1Xuec N91BKxZ6LDOP37gGxOsr0Msq99LKCVrl4WyfS0e3Do+R+DCIoqmOkndYYhcu2oN3ZHn8 HJf2ipKYT75PXSv+fMf+P7P+u2rFiiay+3zxN6qD4xIGCEeFNgf7Y0IuEwpXMnQD0qfj e/lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778848956; x=1779453756; 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=pqILH36+bPjXkI9bIGyaDvTximt2bkQbgl3RjerBI7A=; b=GppqsBSAfJNXCka1w1cVR+n0rNhKPJhkh5OVMZ3+MGzLMq9XUYgiP72og7Aj20uv5s Rx9x//0oHAQbhWM3rD79f44kMu9MIk93Ca72dZUlTbizjoMTpBoRc6ET7upyUzeOrDJY 0rf4oAofbXFOppaw+3SSWK3WybZs0W5bcRU9H6RQYKR2XV+AnI+JbyyqV0UdxsO8VDWF G3okf3MbU2wNkwjpHoNXOuv8E8ASh496H92T6XU0kUI7TgRqQlVIZ4uBcqnuG6lVTN9S 6m3YvguMTNRp1v57sQbUv8CZhzXhkEsManwrybkVMDEiXhUIuTRFmrGomzXvmkSJ8fEz YRtg== X-Forwarded-Encrypted: i=1; AFNElJ/cfYCkQBN8rfrUHaEjiHE41x4uPaXzGtwnjo50q7theV9xx+bYlMnTj2DPWNEKMZo38PkIhMSB7rPUXPo=@vger.kernel.org X-Gm-Message-State: AOJu0YwDuGd0AdmY27xs1PTw8D36zrIrZ4PpqXYq6eX6PSIF+DSEMPan U40+lmvVK48KOSezf0B2kEAqvVWd4fhOweFoF3MZfX0yvosWpuQdFZ/iFXsGeGkf1i054qCW0xT MoS6f5BzaFsgoeTYPo8SiJ/UQW8mlkXHLbSXzGbidr5EBZNACLbObVrDAgkKiGlveBlw= X-Gm-Gg: Acq92OH+algDGcg6yLkxSUJKsL5wz1QMIbgat5E5Odc0wgH9xo/ZHMchmOfPgFDjr+z pR384uyCFXI1ZZUFnLg7krprv3galaekNpl+NJoRU3IjiJ0YKOq1iwB+3Dh68Wcv86jCP1KWOzy Q0bHQMjaV7XSZ4Y0LrNpNDJm6k1AdjYrHGMKzbNhFJkVHWJtysvFqAgscZgRoQU1ZFinjfiLMfU qlAxC5kJtbUlXr7zPjkDS9VyILD/zE3d+DN4laR+qgnNx0r+QoZouqLXrGE3iKupJfiHentLUZO AVprB5U8Bih8NYr5h8DmreSJk4IR9nlMnXwYjc0owpqtZPVQ1VH4eBdCu7pb7zoA/cD8GXVHaxA z5xudfTLEWBNNzMbxRhriF1+82tR5KwKYN4ZhbVCKGDW8w0of+duwgCijPlNSqFvut4yeZQ6oFi FwlaFiKraN3RWiup28apQ4Bm+Syz52Jg== X-Received: by 2002:a17:902:7d96:b0:2b0:bed1:46f7 with SMTP id d9443c01a7336-2bd7e910f99mr29585975ad.37.1778848955464; Fri, 15 May 2026 05:42:35 -0700 (PDT) X-Received: by 2002:a17:902:7d96:b0:2b0:bed1:46f7 with SMTP id d9443c01a7336-2bd7e910f99mr29585415ad.37.1778848954432; Fri, 15 May 2026 05:42:34 -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 d9443c01a7336-2bd5c05f27csm56119395ad.25.2026.05.15.05.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2026 05:42:34 -0700 (PDT) From: Jianping Li To: srini@kernel.org, amahesh@qti.qualcomm.com, arnd@arndb.de, gregkh@linuxfoundation.org, abelvesa@kernel.org, jorge.ramirez-ortiz@linaro.org Cc: Ekansh Gupta , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, quic_chennak@quicinc.com, stable@kernel.org, Jianping Li Subject: [PATCH v5 1/5] misc: fastrpc: Fix initial memory allocation for Audio PD memory pool Date: Fri, 15 May 2026 20:42:13 +0800 Message-Id: <20260515124217.20723-2-jianping.li@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260515124217.20723-1-jianping.li@oss.qualcomm.com> References: <20260515124217.20723-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-Spam-Details-Enc: AW1haW4tMjYwNTE1MDEyOSBTYWx0ZWRfX1tr+HBci+B/m eB14whjbIeNY0v/Kns4bl8UexEItCfgB/QnFSydMD9f01hU37Iu7944BcZeIQ7BS1hnFxficBwp OKzwHSpJWn2mlPigiDzNQ3iIFJDMvQc3BqJVBWAoAwYViN/UQKDt9BV18EaxR6ip3VuEVJg4RQJ bRpH22bZ4oI/uTyJTobf1glUWX7m+e63YuX/gaKLLEKHL4m/rzw2O9UE1UC1KTsgLO0dfdfZ7xM yUut9gkIMtfk+NvrbbEEIpZcxq613fgDQ/83gh+dpEZs22hV8v9f/0CoZk75RucUSFiHMEQhwJP DKgi6k02zSqSHKsb4gMOuW8kIpfBb1qEyv+QqnSq2esyt2Ri6/cp3bDqmwUXs3VtGzG5GgmdcDO A+QrfdfSkYQHw2U0qTReK53RQ5LXsZz2go8WvHTTRt31xyNnFJ2GWRVR23BnWVXEjEacUPQs5c+ Hcqoa6pwx35JBh3doGA== X-Authority-Analysis: v=2.4 cv=cZXiaHDM c=1 sm=1 tr=0 ts=6a0714bd cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=Op9FgWJ_R3wbKKMAuNAA:9 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-GUID: ZTfxQJ_T101Ae1_5gHkHIbbwOdisHxgR X-Proofpoint-ORIG-GUID: ZTfxQJ_T101Ae1_5gHkHIbbwOdisHxgR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-15_03,2026-05-13_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 phishscore=0 suspectscore=0 adultscore=0 bulkscore=0 impostorscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605150129 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 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 1080f9acf70a..8b21f85cd9f4 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1324,7 +1324,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); @@ -1347,12 +1349,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