Commit "
af9572c lib/module: check initstate before inserting module"
removed the check for "we should return -EEXIST" and moved it back to
the start of the function. The problem with this is the following
scenario:
- We check if module is in kernel -> no
- We insert the dependencies
<-- External program loads
the module
- We check if module is in kernel -> yes
- We return 0, when we should return -EEXIST
&& module_is_inkernel(m)) {
DBG(mod->ctx, "Ignoring module '%s': "
"already loaded\n", m->name);
- err = 0;
- free(options);
- continue;
+ err = -EEXIST;
+ goto finish_module;
}
if (print_action != NULL)
print_action(m, false, options ?: "");
options);
}
+finish_module:
free(options);
/*