irqbypass: Drop pointless and misleading THIS_MODULE get/put
authorSean Christopherson <seanjc@google.com>
Fri, 16 May 2025 23:07:27 +0000 (16:07 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 20 Jun 2025 20:52:36 +0000 (13:52 -0700)
commitfa079a0616edbcdad538128306abbc19b68a9863
tree42b1f9be01907431daabdb5d976f3535eb40c025
parentcd4178d19420359554e3da6fd77ecfd0f58067ce
irqbypass: Drop pointless and misleading THIS_MODULE get/put

Drop irqbypass.ko's superfluous and misleading get/put calls on
THIS_MODULE.  A module taking a reference to itself is useless; no amount
of checks will prevent doom and destruction if the caller hasn't already
guaranteed the liveliness of the module (this goes for any module).  E.g.
if try_module_get() fails because irqbypass.ko is being unloaded, then the
kernel has already hit a use-after-free by virtue of executing code whose
lifecycle is tied to irqbypass.ko.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Link: https://lore.kernel.org/r/20250516230734.2564775-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
virt/lib/irqbypass.c