]>
Commit | Line | Data |
---|---|---|
16f00101 JR |
1 | --- linux-gpib-kernel-4.2.0/drivers/gpib/sys/osfuncs.c~ 2018-11-07 15:58:07.000000000 +0100 |
2 | +++ linux-gpib-kernel-4.2.0/drivers/gpib/sys/osfuncs.c 2019-03-10 18:51:26.364983014 +0100 | |
3 | @@ -551,7 +551,11 @@ | |
4 | remain = read_cmd.requested_transfer_count - read_cmd.completed_transfer_count; | |
5 | ||
6 | /* Check write access to buffer */ | |
7 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) | |
8 | if(!access_ok(VERIFY_WRITE, userbuf, remain)) | |
9 | +#else | |
10 | + if(!access_ok(userbuf, remain)) | |
11 | +#endif | |
12 | return -EFAULT; | |
13 | ||
14 | smp_mb__before_atomic(); | |
15 | @@ -626,7 +630,11 @@ | |
16 | remain = cmd.requested_transfer_count - cmd.completed_transfer_count; | |
17 | ||
18 | /* Check read access to buffer */ | |
19 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) | |
20 | if(!access_ok(VERIFY_READ, userbuf, remain)) | |
21 | +#else | |
22 | + if(!access_ok(userbuf, remain)) | |
23 | +#endif | |
24 | return -EFAULT; | |
25 | ||
26 | /* Write buffer loads till we empty the user supplied buffer. | |
27 | @@ -705,7 +713,11 @@ | |
28 | remain = write_cmd.requested_transfer_count - write_cmd.completed_transfer_count; | |
29 | ||
30 | /* Check read access to buffer */ | |
31 | +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) | |
32 | if(!access_ok(VERIFY_READ, userbuf, remain)) | |
33 | +#else | |
34 | + if(!access_ok(userbuf, remain)) | |
35 | +#endif | |
36 | return -EFAULT; | |
37 | ||
38 | smp_mb__before_atomic(); |