diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-11-16 12:05:42 -0200 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-11-16 12:05:42 -0200 |
commit | 02c64df3c2b33880b18d3f4aba9fa8e48e5ca904 (patch) | |
tree | 7acf1e04731eeaed6e6b5bea7290de1bb2c9960e | |
parent | 06294621a944e4611e15ce8201df80870e052e7d (diff) | |
download | kmod-02c64df3c2b33880b18d3f4aba9fa8e48e5ca904.tar.gz |
depmod: fix asserting mod->kmod == NULL
If we are replacing a lower priority module (due to its location), we
already created a kmod_module, but didn't open the file for reading its
symbols. This means mod->kmod won't be NULL, and this is just ok. Since
all the functions freeing stuff below the previous assert already takes
NULL into consideration, it's safe to just unref mod->kmod and let the
right thing happens.
-rw-r--r-- | tools/depmod.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/depmod.c b/tools/depmod.c index aafe66b..7bbdcd3 100644 --- a/tools/depmod.c +++ b/tools/depmod.c @@ -977,7 +977,7 @@ static void mod_free(struct mod *mod) { DBG("free %p kmod=%p, path=%s\n", mod, mod->kmod, mod->path); array_free_array(&mod->deps); - assert(mod->kmod == NULL); + kmod_module_unref(mod->kmod); kmod_module_info_free_list(mod->info_list); kmod_module_dependency_symbols_free_list(mod->dep_sym_list); free(mod->uncrelpath); |