]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
misc: fastrpc: Fix dma_buf object leak in fastrpc_map_lookup
authorJunhao Xie <bigfoot@radxa.com>
Fri, 17 Oct 2025 08:39:06 +0000 (16:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:04:39 +0000 (14:04 +0100)
commitc2fef5ebb73f3dabae6fbc571d181914ed32c483
tree49323becd79ce7bb6e5e8e85f0c82cb26adcc680
parenta70d3e61a0268a86cce63402fe936709501f4b15
misc: fastrpc: Fix dma_buf object leak in fastrpc_map_lookup

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-bigfoot%40radxa.com
Link: https://patch.msgid.link/48B368FB4C7007A7+20251017083906.3259343-1-bigfoot@radxa.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/fastrpc.c