From dbab23da14a71cbc935b7a0159051755534eb6b8 Mon Sep 17 00:00:00 2001 From: Adrien Prost-Boucle Date: Mon, 13 Feb 2017 16:27:06 +0100 Subject: [PATCH] Fix driver for linux >= 4.9 --- driver/linux/riffa_driver.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/driver/linux/riffa_driver.c b/driver/linux/riffa_driver.c index c3e53dd..5cdecf5 100644 --- a/driver/linux/riffa_driver.c +++ b/driver/linux/riffa_driver.c @@ -443,8 +443,10 @@ static inline struct sg_mapping * fill_sg_buf(struct fpga_state * sc, int chnl, down_read(¤t->mm->mmap_sem); #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) num_pages = get_user_pages(current, current->mm, udata, num_pages_reqd, 1, 0, pages, NULL); - #else + #elsif LINUX_VERSION_CODE < KERNEL_VERSION(4,9,0) num_pages = get_user_pages(udata, num_pages_reqd, 1, 0, pages, NULL); + #else + num_pages = get_user_pages(udata, num_pages_reqd, FOLL_WRITE, pages, NULL); #endif up_read(¤t->mm->mmap_sem); if (num_pages <= 0) {