The variable n is intended to track the number of dependencies for mod.
However, it is only initialized and not incremented during dependency parsing.
Fix it.
Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
Fixes: be728dd34718 ("libkmod: Simplify module dependency parsing")
Link: https://github.com/kmod-project/kmod/pull/348
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
(cherry picked from commit
a0fc05940cefa7f79a48132ff6029658b4aeab49)
goto fail;
}
list = l_new;
+ n++;
}
DBG(ctx, "%zu dependencies for %s\n", n, mod->name);