6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junhao Xie bigfoot@radxa.com
commit fff111bf45cbeeb659324316d68554e35d350092 upstream.
In fastrpc_map_lookup, dma_buf_get is called to obtain a reference to the dma_buf for comparison purposes. However, this reference is never released when the function returns, leading to a dma_buf memory leak.
Fix this by adding dma_buf_put before returning from the function, ensuring that the temporarily acquired reference is properly released regardless of whether a matching map is found.
Fixes: 9031626ade38 ("misc: fastrpc: Fix fastrpc_map_lookup operation") Cc: stable@kernel.org Signed-off-by: Junhao Xie bigfoot@radxa.com Tested-by: Xilin Wu sophon@radxa.com Link: https://lore.kernel.org/stable/48B368FB4C7007A7%2B20251017083906.3259343-1-b... Link: https://patch.msgid.link/48B368FB4C7007A7+20251017083906.3259343-1-bigfoot@r... Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- drivers/misc/fastrpc.c | 2 ++ 1 file changed, 2 insertions(+)
--- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -363,6 +363,8 @@ static int fastrpc_map_lookup(struct fas } spin_unlock(&fl->lock);
+ dma_buf_put(buf); + return ret; }