projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c23c5e1
)
misc: ocxl: fix possible refcount leak in afu_ioctl()
author
Hangyu Hua
<hbh25y@gmail.com>
Wed, 24 Aug 2022 08:26:00 +0000
(16:26 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:07 +0000
(12:35 +0200)
[ Upstream commit
c3b69ba5114c860d730870c03ab4ee45276e5e35
]
eventfd_ctx_put need to be called to put the refcount that gotten by
eventfd_ctx_fdget when ocxl_irq_set_handler fails.
Fixes: 060146614643 ("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>
drivers/misc/ocxl/file.c
patch
|
blob
|
history
diff --git
a/drivers/misc/ocxl/file.c
b/drivers/misc/ocxl/file.c
index d278f8ba2c7606384c7175d005db30b8cc713dd2..134806c2e67ec107957acd4e22008b1bded42474 100644
(file)
--- a/
drivers/misc/ocxl/file.c
+++ b/
drivers/misc/ocxl/file.c
@@
-259,6
+259,8
@@
static long afu_ioctl(struct file *file, unsigned int cmd,
if (IS_ERR(ev_ctx))
return PTR_ERR(ev_ctx);
rc = ocxl_irq_set_handler(ctx, irq_id, irq_handler, irq_free, ev_ctx);
+ if (rc)
+ eventfd_ctx_put(ev_ctx);
break;
case OCXL_IOCTL_GET_METADATA: