aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2012-11-16 11:35:30 -0200
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2012-11-16 11:39:41 -0200
commit06294621a944e4611e15ce8201df80870e052e7d (patch)
treeb6389a7c55d2eb14fca39ecb031bc86cbce3e7a8
parentc599606f7525580b0b418a361d1c7798ea6f19f3 (diff)
downloadkmod-06294621a944e4611e15ce8201df80870e052e7d.tar.gz
depmod: fix hash lookup by relpath instead of uncrelpath
We index modules in depmod by it's uncompressed relative path, not relative path. We didn't notice this bug before since this function is only triggered if we release a module to be replaced by one of higher priority. Also fix a leftover log message referring to relpath instead of uncrelpath.
-rw-r--r--tools/depmod.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/depmod.c b/tools/depmod.c
index cc9346f..aafe66b 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -1114,7 +1114,7 @@ static int depmod_module_add(struct depmod *depmod, struct kmod_module *kmod)
mod->uncrelpath, mod);
if (err < 0) {
ERR("hash_add_unique %s: %s\n",
- mod->relpath, strerror(-err));
+ mod->uncrelpath, strerror(-err));
hash_del(depmod->modules_by_name, mod->modname);
goto fail;
}
@@ -1134,8 +1134,8 @@ static int depmod_module_del(struct depmod *depmod, struct mod *mod)
{
DBG("del %p kmod=%p, path=%s\n", mod, mod->kmod, mod->path);
- if (mod->relpath != NULL)
- hash_del(depmod->modules_by_uncrelpath, mod->relpath);
+ if (mod->uncrelpath != NULL)
+ hash_del(depmod->modules_by_uncrelpath, mod->uncrelpath);
hash_del(depmod->modules_by_name, mod->modname);