]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
Format refcount handling
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Thu, 24 Nov 2011 17:41:48 +0000 (15:41 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Fri, 25 Nov 2011 01:09:39 +0000 (23:09 -0200)
libkmod/libkmod.c

index 4407272bd9a4d76b9636c4599a0025795f50f04e..9307f713292fa505f7f613368ab596bfbe4e1278 100644 (file)
@@ -181,8 +181,8 @@ KMOD_EXPORT struct kmod_ctx *kmod_unref(struct kmod_ctx *ctx)
 {
        if (ctx == NULL)
                return NULL;
-       ctx->refcount--;
-       if (ctx->refcount > 0)
+
+       if (--ctx->refcount > 0)
                return ctx;
        info(ctx, "context %p released\n", ctx);
        free(ctx);