Re: [PATCH] irqbypass: add missing module_put() in irq_bypass_register_*()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 23 May 2018 19:29:59 +0300
Emmanouil Maroudas <emmanouil.maroudas@xxxxxxxxx> wrote:

> Hi all,
> 
> It seems that the irq_bypass_register_*() functions are missing a call to module_put() at the end.
> The error paths in these functions and the lock / unlock pattern in the respective irq_bypass_unregister_*() functions seem to confirm this.
> 
> As I am not very familiar to the code, is there any reason to omit module_put() that I am missing?
> If so, maybe some comments would be helpful, explaining why, as currently it is not obvious.
> 
> I send a patch which adds the module_put() calls in case they are actually missing.

I think the code is correct as-is, a producer/consumer needs to hold a
reference to the module for the entire extent of that registration.  The
module reference is released when the producer/consumer is
unregistered.  We can't have the irqbyass module being unloaded with
registrants present.  The error paths do a module_put because the
registration failed.  If you'd like to submit a documentation patch,
please do so, but this is very standard behavior.  Thanks,

Alex



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux