On 02-07-2026 07:51, Eddie Lin wrote:
> The 'ctx_idr' is initialized but never destroyed when
> the channel context is freed, leading to a memory leak.
> Add idr_destroy() to properly clean up the IDR resources.
> 
> Fixes: f6f9279f2bf0 ("misc: fastrpc: Add Qualcomm fastrpc basic driver model")
> Cc: [email protected]
> Signed-off-by: Eddie Lin <[email protected]>
> ---
> Changes in v3:
> - Remove duplicate description from cover letter.
> - Link to v2: 
> https://patch.msgid.link/[email protected]
> 
> Changes in v2:
> - Added Fixes tag.
> - Added Cc: [email protected].
> - Removed duplicate description from cover letter.
> - Link to v1: 
> https://patch.msgid.link/[email protected]
> ---
>  drivers/misc/fastrpc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index a9b2ae44c06f..7727850e9240 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -492,6 +492,7 @@ static void fastrpc_channel_ctx_free(struct kref *ref)
>  
>       cctx = container_of(ref, struct fastrpc_channel_ctx, refcount);
>  
> +     idr_destroy(&cctx->ctx_idr);
>       kfree(cctx);
>  }
>  
Reviewed-by: Ekansh Gupta <[email protected]>
> 
> ---
> base-commit: abe651837cb394f76d738a7a747322fca3bf17ba
> change-id: 20260611-fastrpc-cctx-cleanup-bfd20aa7b8a0
> 
> Best regards,
> --  
> Eddie Lin <[email protected]>
> 

Reply via email to