summarylogtreecommitdiffstats
path: root/fixnxusb.patch
blob: 9b19fbdf7c0f29687521746f1f09975769aec315 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--- ./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 <linux/version.h>
 #include <linux/types.h>
 #include <linux/usb.h>
 /*****************************************************************************/
@@ -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
 }
 
 /*****************************************************************************/