[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0ee42968-f742-56dd-78c3-b70a1c9c40af@linux.ibm.com>
Date: Wed, 24 Aug 2022 11:42:37 +0200
From: Frederic Barrat <fbarrat@...ux.ibm.com>
To: Hangyu Hua <hbh25y@...il.com>, ajd@...ux.ibm.com, arnd@...db.de,
gregkh@...uxfoundation.org, alastair@...ilva.org,
mpe@...erman.id.au
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] misc: ocxl: fix possible refcount leak in afu_ioctl()
On 24/08/2022 10:26, Hangyu Hua wrote:
> 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")
> Signed-off-by: Hangyu Hua <hbh25y@...il.com>
> ---
Thanks for fixing it! LGTM
Acked-by: Frederic Barrat <fbarrat@...ux.ibm.com>
Fred
> drivers/misc/ocxl/file.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c
> index 6777c419a8da..d46dba2df5a1 100644
> --- a/drivers/misc/ocxl/file.c
> +++ b/drivers/misc/ocxl/file.c
> @@ -257,6 +257,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:
Powered by blists - more mailing lists