+--- NVIDIA-Linux-x86_64-304.131-no-compat32/kernel/nv-mlock.c~ 2015-11-09 06:43:39.000000000 +0100
++++ NVIDIA-Linux-x86_64-304.131-no-compat32/kernel/nv-mlock.c 2016-06-19 18:34:23.039063568 +0200
+@@ -49,7 +49,11 @@
+ }
+
+ down_read(&mm->mmap_sem);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
++ ret = get_user_pages((unsigned long)address,
++#else
+ ret = get_user_pages(current, mm, (unsigned long)address,
++#endif
+ page_count, write, force, user_pages, NULL);
+ up_read(&mm->mmap_sem);
+ pinned = ret;
+@@ -62,7 +66,11 @@
+ else if (pinned < page_count)
+ {
+ for (i = 0; i < pinned; i++)
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
++ put_page(user_pages[i]);
++#else
+ page_cache_release(user_pages[i]);
++#endif
+ os_free_mem(user_pages);
+ return RM_ERR_INVALID_ADDRESS;
+ }
+@@ -88,7 +88,11 @@
+ {
+ pci_unmap_page(dev, pte_array[j],
+ PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
++ put_page(user_pages[j]);
++#else
+ page_cache_release(user_pages[j]);
++#endif
+ }
+ os_free_mem(user_pages);
+ return RM_ERR_OPERATING_SYSTEM;
+@@ -122,7 +126,11 @@
+ PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
+ if (write)
+ set_page_dirty_lock(user_pages[i]);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
++ put_page(user_pages[i]);
++#else
+ page_cache_release(user_pages[i]);
++#endif
+ }
+
+ os_free_mem(user_pages);