Skip to content

Commit

Permalink
ltq-atm: add Linux 5.0+ compatibility
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mkresin committed Mar 16, 2020
1 parent c01c018 commit a3539c8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions package/kernel/lantiq/ltq-atm/src/ltq_atm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a3539c8

Please sign in to comment.