Thread (134 messages) 134 messages, 10 authors, 2024-11-11

Re: [PATCH 36/39] assorted variants of irqfd setup: convert to CLASS(fd)

From: Christian Brauner <brauner@kernel.org>
Date: 2024-08-07 10:46:40
Also in: bpf, cgroups, kvm, linux-fsdevel

On Tue, Jul 30, 2024 at 01:16:22AM GMT, viro@kernel.org wrote:
From: Al Viro <viro@zeniv.linux.org.uk>

in all of those failure exits prior to fdget() are plain returns and
the only thing done after fdput() is (on failure exits) a kfree(),
They could also be converted to:

struct virqfd *virqfd __free(kfree) = NULL;

and then direct returns are usable.
which can be done before fdput() just fine.

NOTE: in acrn_irqfd_assign() 'fail:' failure exit is wrong for
eventfd_ctx_fileget() failure (we only want fdput() there) and once
we stop doing that, it doesn't need to check if eventfd is NULL or
ERR_PTR(...) there.

NOTE: in privcmd we move fdget() up before the allocation - more
to the point, before the copy_from_user() attempt.

[trivial conflict in privcmd]

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
Reviewed-by: Christian Brauner <brauner@kernel.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help