diff --git a/lib/kref.c b/lib/kref.c index 9ecd6e8..e143fd8 100644 --- a/lib/kref.c +++ b/lib/kref.c @@ -64,6 +64,8 @@ int kref_put(struct kref *kref, void (*release)(struct kref *kref)) WARN_ON(release == NULL); WARN_ON(release == (void (*)(struct kref *))kfree); + WARN_ON((atomic_read(&kref->refcount) & 0xffffffff) == 0x6b6b6b6b); + if (atomic_dec_and_test(&kref->refcount)) { release(kref); return 1;