lkml.org 
[lkml]   [2008]   [Jan]   [12]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSat, 12 Jan 2008 13:52:20 +0800
Fromrmingming <>
SubjectQustion on function try_module_get()
Hi,
 I have a problem about the try_module_get function, I don't know if someone
removed the module just AFTER line 372 and BEFORE line 373, then
what happens? Because in this situation, the variable "module" will be
incorrect, and module_is_live function will lead to unpredicatable behaviour.

368 static inline int try_module_get(struct module *module)
369 {
370         int ret = 1;
371
372         if (module) {
373                 unsigned int cpu = get_cpu();
374                 if (likely(module_is_live(module)))
375                         local_inc(&module->ref[cpu].count);
376                 else
377                         ret = 0;
378                 put_cpu();
379         }
380         return ret;
381 }
Best wishes to all,

rmingming


\
 
 \ /
  Last update: 2008-01-12 06:55    [from the cache]
©2003-2008