summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorAnandu Krishnan E <anandu.e@oss.qualcomm.com>2026-07-24 23:33:40 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-31 10:59:47 +0200
commit310f7868399668c6d99d88acc9c4cf3462e69d5b (patch)
treee06b074489d6356e2088025d96bbb2ab8e25fb86 /drivers/misc
parentb85a0e91d7d6cd06a53c881a46f749cfcef416a2 (diff)
downloadlinux-next-310f7868399668c6d99d88acc9c4cf3462e69d5b.tar.gz
linux-next-310f7868399668c6d99d88acc9c4cf3462e69d5b.zip
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. Fixes: 278d56f970ae ("misc: fastrpc: Reference count channel context") Cc: stable@kernel.org Signed-off-by: Anandu Krishnan E <anandu.e@oss.qualcomm.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Srinivas Kandagatla <srini@kernel.org> Link: https://patch.msgid.link/20260724223342.629168-5-srini@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/fastrpc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index c75eafe872cc..f8cbe30c5d5c 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -1675,7 +1675,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;
}