From mboxrd@z Thu Jan 1 00:00:00 1970 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 D4D833016F1 for ; Mon, 2 Feb 2026 06:43:07 +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=1770014589; cv=none; b=oVYFdoQZ0hmF4AEGwD6xAwKbIv7U8/XjAUayNQlUeB5CA9IyEsyV86qj636irNUSY02zzLMA0ICeKXdGwsAWoLvOelXd7Mn1crXvEx9eq44D9Yj0tPniLCNNRgZZ3uT+j6g/ml9AqbB8P8/i3K4lzs5ZvO25cmxJDyfiu6mmf9M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770014589; c=relaxed/simple; bh=0QxdRRGpmuIecdPS/q1kZFw2J3XPD1P51KJvNXLxPaY=; h=Message-ID:Date:MIME-Version:Subject:To:References:From:Cc: In-Reply-To:Content-Type; b=mih7cdUNUnPKHTTc3CIoCf7PhULJArIxCMwykarDXhAgxqhRlxuzyHVz0n6XwUXrXfSGhmLb5P3p1SkMRk7E09HnH4SoyM2jzs+7OaU7Du1iY/K7JJIxxHdDquAuBPFxldAKs7DKJeOz2V/VRunG4goA2X1K+UWYqnLClQ5a6wQ= 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=Nu70XBL9; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=GTJ62tfZ; 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="Nu70XBL9"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="GTJ62tfZ" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 611MRVgM1657605 for ; Mon, 2 Feb 2026 06:43:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= leBHcha+xx0Mjdv7gXom56khxN7YVJH9u22bC5K4cNk=; b=Nu70XBL9d6kaVyiy pvI352fi69qp3GEJDRWPOPmRuEp6CVB163B9BW9/l/2K6NsufX4q40tUnFP/V/+I EPhbeGeeLnSi2zj1wzp5QdBQFN/ndEm/D2m7SmFpEaooXm5VcsVE47wX0kVFSp76 Ye7uMFCeladw6kpZItB+ygbogTR19oyQ9YwnJp5cIz3dWIKwHCUbQuwQWu3Jqzv9 MRuMBlgT8bCnL13HV528BmT7DprY8UpErw+6SWvb0zS2Zjz6xR/t4KsoX+/jh+4b bmb1v33Py/7lP6610MLldkOwi+WtEAYw0FkBwq5kLpcj8zSmWfvr5qa+mR9t9UYC g4BF3A== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c23h1hy34-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 02 Feb 2026 06:43:06 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-29f29ae883bso29902815ad.3 for ; Sun, 01 Feb 2026 22:43:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770014586; x=1770619386; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:cc:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=leBHcha+xx0Mjdv7gXom56khxN7YVJH9u22bC5K4cNk=; b=GTJ62tfZSbvBuRphw/5Y3MZeXeAd3r9dRb68LswU3xy2oPsk1Vv1RmjuTvgdiGOwA8 9FFRTmWQ8IS/s2nVWjljQnZ/Kiua30IczG1CRtg17guTde0NrJMOo0XgpgSqz7enEfyl LIKkICFa4OPQinl8dja7IuYbG5YSFX0j0Avdk26fBYelxkLjVLvM4iDh4bqwRaRi3EdN NDqiQsByhBnngizTnyPe3C8U5ngt1NdDFMvHmLJsrNw4EVK2Z/BWqtZ9g3/XlJLKMXLh yIG9XM5t2k/oC7tfBmMamAPkpAwLPkD3gV5py7VO2RqMcBvTh2MIO753qwcgsFJuh7s5 iJ6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770014586; x=1770619386; h=content-transfer-encoding:in-reply-to:cc:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=leBHcha+xx0Mjdv7gXom56khxN7YVJH9u22bC5K4cNk=; b=Oklv6upBDWrfnP9wEq/KLde8TTx5+1HAo3tNnMAJEymIMkLo1J7a0USIF6B7HZRDP3 7K+eKR1+xsp4ouPuSSenW9WfLmqF1ja3E8kUNq7D03bhGmtRvIjoX4J5PuqOUOKK1W+u dWsoiniKVkSgB+gcgfV7DRzbVlBCSyiu8EcHaHZqLtenRCLu+JsN7d9bPRY6sTryhYSg v3b6KLa+tSwluD9VreT8v0CgR+bdvGc9YEJPpttpy5W89404Lh/C5UhAj32DK3TEpLv4 MsX2FiZG4b9ZwoFmuMRtHOtkzWmlXBYjJySEg2NzW09dIXl3UXQaX7R+gncMcgF02VQY m1zw== X-Forwarded-Encrypted: i=1; AJvYcCX2aX61qN7q04sxe2iIzz+c5KZTkn39v/9XOo7CibV+IJ+FfLgMImvYEkWkjSlrIc+vmAbOfFPwr0zv9YE=@vger.kernel.org X-Gm-Message-State: AOJu0YzWTwh9l6GinzdL1ca5MsxuPKM/wOlowj/8nQBwwzuXjnpX2yAG yf+NadlxqivXIAGrIxTZSZR6arSobrvMfiUHp7i4jk0aPbe2zRKTRxZSA3gEjz6OKWpQEmRHq++ LTeWPC7RyceiEupYH73B+yPohLddPGTeH/DzQ/32lzp9gPVrdsCLvHWh7qw9q51GwMkc= X-Gm-Gg: AZuq6aIb/eNWsCwbMWsCE9T0j/zp5XnNhU3Q2XRd/Qmsq9x0n2BCXaWoha8KP+I3CNh ICoMcdB4L7K04IQTSi6ml3aQcCsuEimUp7lrMWG9e364qBRiq0c/Ar3oGZotwswOHFG63r5bgx3 dHCNKUlok1fLk6WUlHP4uIk+6ASGHyvYkpoYua/JU2dzuhnyrLh7s6tCsZnQ/jxkNNSZAo3feYs NEwlefMR0CXl4ibxjURYG+iyTRbfv2GkEfvBqJxqQ/Di/Rm+v8WqdXu7EV8ZbHUJm8K29eMjuLh sKhrsH6WC4Tv0MKl8i7boojfBqPUYk22n/tPaS8UOYvsf3UtHDEFtcoQ0+wDD9QjJutsHatXJFG bXYWbmt4QnLMURO/CAq9tm+ndkIjIS+JRly99vWN+KNJrw3hVcQvq4HS9JHD0tjFgf2vXOO/Sip 7cI6bJ X-Received: by 2002:a17:903:1a2e:b0:2a7:cecb:9845 with SMTP id d9443c01a7336-2a8d9a51c32mr114093005ad.52.1770014586314; Sun, 01 Feb 2026 22:43:06 -0800 (PST) X-Received: by 2002:a17:903:1a2e:b0:2a7:cecb:9845 with SMTP id d9443c01a7336-2a8d9a51c32mr114092675ad.52.1770014585790; Sun, 01 Feb 2026 22:43:05 -0800 (PST) Received: from [10.133.33.100] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a8b47f4717sm126072825ad.18.2026.02.01.22.43.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Feb 2026 22:43:05 -0800 (PST) Message-ID: <8b696463-ec6e-4671-8176-432add3b0e70@oss.qualcomm.com> Date: Mon, 2 Feb 2026 14:42:59 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/4] misc: fastrpc: Fix initial memory allocation for Audio PD memory pool To: Dmitry Baryshkov References: <20260115082851.570-1-jianping.li@oss.qualcomm.com> <20260115082851.570-3-jianping.li@oss.qualcomm.com> Content-Language: en-US From: Jianping Cc: srini@kernel.org, amahesh@qti.qualcomm.com, arnd@arndb.de, gregkh@linuxfoundation.org, linux-arm-msm@vger.kernel.org, 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 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: ADG1zBLOWoVVCrkAhGeeDoYuAiZceQG9 X-Proofpoint-ORIG-GUID: ADG1zBLOWoVVCrkAhGeeDoYuAiZceQG9 X-Authority-Analysis: v=2.4 cv=Fu8IPmrq c=1 sm=1 tr=0 ts=6980477a cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=5IayI-uhQhADWBiAsg0A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjAyMDA1NiBTYWx0ZWRfX1g4QCXeU5T5n 3r58z/LZ8gO8cgs/AjgSiFhbqUgoxHYgAHB6LVEWa1C6Ss7TIN2VzezMwv7SCPVbVpDtEYQiaQM NntZZXGbN4GbU6uVq3gNGQAfaJylZbnVOyNHOJ81XrAAKNkLviCfwVAMzv+oYTzXg/P/LZm3ejl QBy+4oqdLXIKq9B9mKvx17dn605/Ggzq8R03IzRqpiDzy7+TjwvwNAsfJjCC9c5COBZsIkrqED/ 6XMEMa45RQ7gSkDw9bV+wDOCfTFDl5Mks9rJCirK/ptdwVf24Is2ItZiRJKDytYpFKQmOLtdKKR hHzOiMw0XDB8MFz7pAPGZjwOcw5Qmh/oyBjLO1KyDkYMmfcXfZ6/qLR3AUnU4VFkSEcOrRQLFE6 UAuDspu4IdUsNjHLHRSsnPsHvc05/6zchQB7UrQAP0Q+5dU/6SUyG9Ss+dJleHMIyifc9MebabH sNi9xVWfi9mBc6tvPsA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-02_02,2026-01-30_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 lowpriorityscore=0 priorityscore=1501 clxscore=1015 suspectscore=0 bulkscore=0 malwarescore=0 adultscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602020056 On 1/16/2026 4:45 AM, Dmitry Baryshkov wrote: > On Thu, Jan 15, 2026 at 04:28:49PM +0800, Jianping Li wrote: >> From: Ekansh Gupta >> >> The initially allocated memory is not properly included in the pool, >> leading to potential issues with memory management. The issue is > > Define "properly" and be more explicit about "potential issues". Please > be more precise in commit messages. By “properly” I mean that the initially allocated buffer is supposed to be added into the Audio PD memory pool by setting pageslen accordingly. With pageslen = 0, this buffer is never registered and therefore never becomes part of the pool. I will drop the vague wording and describe the exact problem. > >> actually a memory leak because the initial memory is never used by > > Why is it not used? Because pageslen = 0 indicates that no pages are provided. As a result, Audio PD immediately issues a remote heap request, ignoring the initially allocated memory entirely. That initial buffer becomes unreachable and is effectively leaked. > >> Audio PD. It will immediately make a remote heap request as no memory is > > Ok, you've described one issue. Beforehand it was "issues". Are there > any others? if not, please drop the "potential issues" part. There are no additional issues beyond the memory leak caused by the unused initial buffer. I will remove the “potential issues” phrasing and state explicitly that the problem is a memory leak due to the initial buffer never being added to the pool. > >> 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(-) >> > > The patch LGTM. >