misc: fastrpc: fix channel ctx ref leak when session alloc fails
PATCH 1/1 misc: fastrpc: fix channel ctx ref leak when session alloc fails
fastrpc_channel_ctx_get() is called in fastrpc_device_open() before fastrpc_session_alloc(). If session alloc fails, the error path returns -EBUSY without calling fastrpc_channel_ctx_put(), leaking the reference. Fix by adding the missing put.
--- drivers/misc/fastrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/fastrpc.c +1 -1
@@ -1648,7 +1648,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp)dev_err (&cctx->rpdev->dev,"No session available\n" );mutex_destroy (&fl->mutex);kfree (fl); - +fastrpc_channel_ctx_put (cctx);return -EBUSY ; }
Signature · 1 line
2.34.1
Quoted 5 lines · Anandu Krishnan E
fastrpc_channel_ctx_get()is called infastrpc_device_open()beforefastrpc_session_alloc(). If session alloc fails, the error path returns-EBUSYwithout callingfastrpc_channel_ctx_put(), leaking the reference. Fix by adding the missing put.
Quoted 7 lines
Fixes 278d56f970ae ("misc: fastrpc: Reference count channel context")Signed-off-by Anandu Krishnan E <[email protected]>--- drivers/misc/fastrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 2 lines
With best wishes Dmitry
Quoted 6 lines · Anandu Krishnan E
fastrpc_channel_ctx_get()is called infastrpc_device_open()beforefastrpc_session_alloc(). If session alloc fails, the error path returns-EBUSYwithout callingfastrpc_channel_ctx_put(), leaking the reference. Fix by adding the missing put.
Applied, thanks!
[1/1] misc: fastrpc: fix channel ctx ref leak when session alloc fails
commit: c48eabae708407d4f26eeb81f9fe8215741b78fb
Best regards,
Signature · 1 line
Srinivas Kandagatla <[email protected]>