Skip to content

Commit fff111b

Browse files
BigfootACAgregkh
authored andcommitted
misc: fastrpc: Fix dma_buf object leak in fastrpc_map_lookup
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: 9031626 ("misc: fastrpc: Fix fastrpc_map_lookup operation") Cc: [email protected] Signed-off-by: Junhao Xie <[email protected]> Tested-by: Xilin Wu <[email protected]> Rule: add Link: https://lore.kernel.org/stable/48B368FB4C7007A7%2B20251017083906.3259343-1-bigfoot%40radxa.com Link: https://patch.msgid.link/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 410d6c2 commit fff111b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/misc/fastrpc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ static int fastrpc_map_lookup(struct fastrpc_user *fl, int fd,
381381
}
382382
spin_unlock(&fl->lock);
383383

384+
dma_buf_put(buf);
385+
384386
return ret;
385387
}
386388

0 commit comments

Comments
 (0)