Messages in this thread | | | Date | Fri, 23 Jan 2015 05:17:58 -0800 | From | Christoph Hellwig <> | Subject | Re: module: fix module_refcount() return when running in a module exit routine |
| |
On Fri, Jan 23, 2015 at 01:24:15PM +1030, Rusty Russell wrote: > The correct fix is to turn try_module_get() into __module_get(), and > always do the module_put().
Is this really safe? __module_get sais it needs a non-zero refcount to start with, but scsi_device_get is the only thing every incrementing the refcount on the module pointer in the scsi host template, so exactly that case can happen easily. There's not assert actually hardcoding the assumption, so I'm not sure if requirement the comment really just is nice to have or a strong requirement.
| |