]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
assorted variants of irqfd setup: convert to CLASS(fd)
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 20 Jul 2024 05:48:34 +0000 (01:48 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 3 Nov 2024 06:28:07 +0000 (01:28 -0500)
commit66635b0776243ff567db08601546b7f26b67dd08
tree9f7c80007c9a47864612edb5dacd84ce3eb7d8c9
parent89359897983825dbfc08578e7ee807aaf24d9911
assorted variants of irqfd setup: convert to CLASS(fd)

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(),
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.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/vfio/virqfd.c
drivers/virt/acrn/irqfd.c
drivers/xen/privcmd.c
virt/kvm/eventfd.c