Hi Jan, > The cleanup_module function has no way whatsoever preventing > the unload. > If a module can't be unloaded, cleanup_module is not called at all. So > this is not the problem. AFAIK when u call rmmod, the function that gets called is delete_module which inturn calls cleanup_module() The general practice what ppl follow in cleanup_module is kfree() all the memory that has been allocated before(using kmalloc), then call MOD_DEC_USE_COUNT , to decrease the count , But IMHO , if u are not freeing the memory that has been allocated before, then u r module is for sure to crash !!! Let me know if im wrong , Rgds Anand > -----Original Message----- > From: Jan Hudec [mailto:bulb@vagabond.light.src]On Behalf Of Jan Hudec > Sent: Thursday, June 10, 2004 3:22 PM > To: Anandraj > Cc: 'l x'; kernelnewbies@nl.linux.org > Subject: Re: Help - can not rmmod a module > > > On Thu, Jun 10, 2004 at 09:53:35 +0530, Anandraj wrote: > > Hi > > check wheather u r freeing the memory u have allocated in > init_module or > > some were else! > > The memory allocated should be freeed atleast in the > cleanup_module() > > The cleanup_module function has no way whatsoever preventing > the unload. > If a module can't be unloaded, cleanup_module is not called at all. So > this is not the problem. > > -------------------------------------------------------------- > ----------------- > Jan 'Bulb' > Hudec <bulb@ucw.cz> > -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/