aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2019-07-07 17:13:18 +0200
committerMathias Kresin <dev@kresin.me>2020-03-16 22:28:16 +0100
commita3539c82cb38366151019438ea841e8ae47cb1c2 (patch)
tree073f7df08bda657e172a0b6eb230739f3b51e731 /package/kernel
parentc01c01891c185d204de1aa8f3f7af1c05f78f09b (diff)
downloadupstream-a3539c82cb38366151019438ea841e8ae47cb1c2.tar.gz
upstream-a3539c82cb38366151019438ea841e8ae47cb1c2.tar.bz2
upstream-a3539c82cb38366151019438ea841e8ae47cb1c2.zip
ltq-atm: add Linux 5.0+ compatibility
Upstream commit 96d4f267e40f95 ("Remove 'type' argument from access_ok() function") removes the first argument to access_ok. Adjust the code so it builds with Linux 5.4. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'package/kernel')
-rw-r--r--package/kernel/lantiq/ltq-atm/src/ltq_atm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
index 6e6f4c66c7..267a515df6 100644
--- a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
+++ b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c
@@ -289,9 +289,17 @@ static int ppe_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg)
return -ENOTTY;
if ( _IOC_DIR(cmd) & _IOC_READ )
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)
+ ret = !access_ok(arg, _IOC_SIZE(cmd));
+#else
ret = !access_ok(VERIFY_WRITE, arg, _IOC_SIZE(cmd));
+#endif
else if ( _IOC_DIR(cmd) & _IOC_WRITE )
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)
+ ret = !access_ok(arg, _IOC_SIZE(cmd));
+#else
ret = !access_ok(VERIFY_READ, arg, _IOC_SIZE(cmd));
+#endif
if ( ret )
return -EFAULT;