Skip to content

Commit

Permalink
module: module_unload_init() cleanup
Browse files Browse the repository at this point in the history
No need to clear mod->refptr in module_unload_init(), since
alloc_percpu() already clears allocated chunks.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (removed unused var)
  • Loading branch information
Eric Dumazet authored and Rusty Russell committed Aug 5, 2010
1 parent 3cfc2c4 commit 2409e74
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,14 +526,8 @@ EXPORT_TRACEPOINT_SYMBOL(module_get);
/* Init the unload section of the module. */
static void module_unload_init(struct module *mod)
{
int cpu;

INIT_LIST_HEAD(&mod->source_list);
INIT_LIST_HEAD(&mod->target_list);
for_each_possible_cpu(cpu) {
per_cpu_ptr(mod->refptr, cpu)->incs = 0;
per_cpu_ptr(mod->refptr, cpu)->decs = 0;
}

/* Hold reference count during initialization. */
__this_cpu_write(mod->refptr->incs, 1);
Expand Down

0 comments on commit 2409e74

Please sign in to comment.