--- ./message_queue.c 2017-06-14 17:20:08.326706223 +0200 +++ ./message_queue.c 2017-06-13 18:11:30.638151756 +0200 @@ -517,7 +517,11 @@ static void precache_msg_hdr(size_t size int message_queue_init(void) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) unsigned long flags = eveusb_debug ? SLAB_DEBUG_FREE | SLAB_RED_ZONE | SLAB_POISON : 0; // module parameter +#else + unsigned long flags = eveusb_debug ? SLAB_CONSISTENCY_CHECKS | SLAB_RED_ZONE | SLAB_POISON : 0; // module parameter +#endif message_up_cache = kmem_cache_create("message_up", // see KMEM_CACHE sizeof(struct message_up), --- ./utils.h 2017-06-14 17:19:46.096726234 +0200 +++ ./utils.h 2017-06-13 18:11:30.638151756 +0200 @@ -43,6 +43,7 @@ #ifndef EVEUSB_KERNEL_UTILS_H #define EVEUSB_KERNEL_UTILS_H /*****************************************************************************/ +#include #include #include /*****************************************************************************/ @@ -77,7 +78,11 @@ size_t get_list_size(const struct list_h static inline int get_refcount(const struct kref *ref) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) return ref ? atomic_read(&ref->refcount) : 0; +#else + return ref ? atomic_read(&ref->refcount.refs) : 0; +#endif } /*****************************************************************************/