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

Re: MOD_INC_USE_COUNT





Jose Luis Alarcon wrote:

>   Hi, kernel developers.
> 
>   I has a big surprise when, adding at the beginning of init_module()
> the macro MOD_INC_USE_COUNT, for have a module use counter. My program
> get compile well and insmod work too.
> 
>   But the surprise was when i did rmmod, cos the output said:
> 
> FATAL: the module is in use
> 
>   I did lsmod, and i got that my module was used by [unsafe].
> 
>   Any kernel programmer with experience knows why happen this?.
> 
>   IMHO a use counter is a very few dangerous thing. So i was trying with.
> 
>   Thanks you, very much, in advance.
> 
>   Regards.
> 
>   Jose.
> 

I don't know why this happens,
but can it be, that you forgot MOD_DEC_USE_COUNT in your cleanup routine ?

bye
Edward

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/