diff options
| author | Gustavo Sverzut Barbieri <barbieri@profusion.mobi> | 2011-12-04 12:34:02 -0200 |
|---|---|---|
| committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2011-12-04 17:24:08 -0200 |
| commit | 87ca03bd0776e863a9d51f20129151137a2c8691 (patch) | |
| tree | 827c56e39b8c8f8a058aaca84b17f8517bfb09ad /libkmod/libkmod-module.c | |
| parent | 32c328d28e36e6b70debff865fdbfbce41c8f59a (diff) | |
| download | kmod-87ca03bd0776e863a9d51f20129151137a2c8691.tar.gz | |
module refcount should start at 1.
the current way was having the referenced modules to be released given
the unref comparison checking for "> 0".
Diffstat (limited to 'libkmod/libkmod-module.c')
| -rw-r--r-- | libkmod/libkmod-module.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c index ac815b2..9c679cb 100644 --- a/libkmod/libkmod-module.c +++ b/libkmod/libkmod-module.c @@ -142,6 +142,7 @@ KMOD_EXPORT int kmod_module_new_from_name(struct kmod_ctx *ctx, m->ctx = kmod_ref(ctx); m->name = strdup(name); + m->refcount = 1; *mod = m; @@ -171,6 +172,7 @@ KMOD_EXPORT int kmod_module_new_from_path(struct kmod_ctx *ctx, m->ctx = kmod_ref(ctx); m->path = strdup(path); + m->refcount = 1; *mod = m; |
