parse_depline may be called from libkmod.c
allow parse_depline to be called when already initialized as it may be
called from libkmod.c and at that point there is no way to check
mod->init.dep
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index 24d2f06..b10d412 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -47,6 +47,7 @@
char *path;
struct kmod_list *dep;
int refcount;
+ int n_dep;
struct {
bool dep : 1;
} init;
@@ -111,7 +112,9 @@
int err, n = 0;
size_t dirnamelen;
- assert(!mod->init.dep && mod->dep == NULL);
+ if (mod->init.dep)
+ return mod->n_dep;
+ assert(mod->dep == NULL);
mod->init.dep = true;
p = strchr(line, ':');
@@ -166,6 +169,7 @@
DBG(ctx, "%d dependencies for %s\n", n, mod->name);
mod->dep = list;
+ mod->n_dep = n;
return n;
fail: