Skip to content

Commit 10c92d2

Browse files
ekanshibuJianping-Li
authored andcommitted
FROMLIST: misc: fastrpc: Fix initial memory allocation for Audio PD memory pool
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. Link: https://lore.kernel.org/all/20260407100508.1027-2-jianping.li@oss.qualcomm.com/ Fixes: 0871561 ("misc: fastrpc: Add support for audiopd") Cc: stable@kernel.org Co-developed-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com> Signed-off-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com> Signed-off-by: Jianping Li <jianping.li@oss.qualcomm.com>
1 parent 2cea4c7 commit 10c92d2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/misc/fastrpc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,9 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
14231423
err = PTR_ERR(name);
14241424
goto err;
14251425
}
1426-
1426+
inbuf.client_id = fl->client_id;
1427+
inbuf.namelen = init.namelen;
1428+
inbuf.pageslen = 0;
14271429
if (!fl->cctx->remote_heap) {
14281430
err = fastrpc_remote_heap_alloc(fl, fl->sctx->dev, init.memlen,
14291431
&fl->cctx->remote_heap);
@@ -1444,12 +1446,10 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl,
14441446
goto err_map;
14451447
}
14461448
scm_done = true;
1449+
inbuf.pageslen = 1;
14471450
}
14481451
}
14491452

1450-
inbuf.client_id = fl->client_id;
1451-
inbuf.namelen = init.namelen;
1452-
inbuf.pageslen = 0;
14531453
fl->pd = USER_PD;
14541454

14551455
args[0].ptr = (u64)(uintptr_t)&inbuf;

0 commit comments

Comments
 (0)