mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
misc: ocxl: fix possible refcount leak in afu_ioctl()
[ Upstream commitc3b69ba511
] eventfd_ctx_put need to be called to put the refcount that gotten by eventfd_ctx_fdget when ocxl_irq_set_handler fails. Fixes:0601466146
("ocxl: move event_fd handling to frontend") Acked-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Hangyu Hua <hbh25y@gmail.com> Link: https://lore.kernel.org/r/20220824082600.36159-1-hbh25y@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3daafa213c
commit
66032c4329
1 changed files with 2 additions and 0 deletions
|
@ -257,6 +257,8 @@ static long afu_ioctl(struct file *file, unsigned int cmd,
|
||||||
if (IS_ERR(ev_ctx))
|
if (IS_ERR(ev_ctx))
|
||||||
return PTR_ERR(ev_ctx);
|
return PTR_ERR(ev_ctx);
|
||||||
rc = ocxl_irq_set_handler(ctx, irq_id, irq_handler, irq_free, ev_ctx);
|
rc = ocxl_irq_set_handler(ctx, irq_id, irq_handler, irq_free, ev_ctx);
|
||||||
|
if (rc)
|
||||||
|
eventfd_ctx_put(ev_ctx);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OCXL_IOCTL_GET_METADATA:
|
case OCXL_IOCTL_GET_METADATA:
|
||||||
|
|
Loading…
Reference in a new issue