From 596ecdecc692627884311dc9f01a62f74886d522 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Wed, 23 Nov 2005 12:59:44 +0000 Subject: [PATCH] Deal with varying return type for kref_put in newer kernels. --- include/linux/kref.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/linux/kref.h b/include/linux/kref.h index f7a51121..20d4aa38 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h @@ -98,7 +98,16 @@ static inline void KREF_INIT(struct kref *kref, void (*release) (struct kref *kr static inline int KREF_PUT(struct kref *kref, void (*release) (struct kref *kref)) { - return kref_put(kref, release); + int retval; + if(atomic_read(&kref->refcount) == 1) + { + retval = 1; + }else + { + retval = 0; + } + kref_put(kref, release); + return retval; } #endif // LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) -- 2.26.2