Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 1 | From f60aa08c63fc02780554a0a12180a478ca27d49f Mon Sep 17 00:00:00 2001 |
| 2 | From: =?UTF-8?q?Horia=20Geant=C4=83?= <horia.geanta@nxp.com> |
| 3 | Date: Wed, 23 May 2018 18:43:39 +0300 |
| 4 | Subject: [PATCH] ioctl.c: Fix build with linux 4.17 |
| 5 | MIME-Version: 1.0 |
| 6 | Content-Type: text/plain; charset=UTF-8 |
| 7 | Content-Transfer-Encoding: 8bit |
| 8 | |
| 9 | Since kernel 4.17-rc1, sys_* syscalls can no longer be called directly: |
| 10 | 819671ff849b ("syscalls: define and explain goal to not call syscalls in the kernel") |
| 11 | |
| 12 | Since cryptodev uses sys_close() - and this has been removed in commit: |
| 13 | 2ca2a09d6215 ("fs: add ksys_close() wrapper; remove in-kernel calls to sys_close()") |
| 14 | cryptodev has to be updated to use the ksys_close() wrapper. |
| 15 | |
| 16 | Signed-off-by: Horia Geantă <horia.geanta@nxp.com> |
| 17 | |
| 18 | Upstream-Status: Backport |
| 19 | |
| 20 | Signed-off-by: He Zhe <zhe.he@windriver.com> |
| 21 | --- |
| 22 | ioctl.c | 4 ++++ |
| 23 | 1 file changed, 4 insertions(+) |
| 24 | |
| 25 | diff --git a/ioctl.c b/ioctl.c |
| 26 | index d831b0c..2571034 100644 |
| 27 | --- a/ioctl.c |
| 28 | +++ b/ioctl.c |
| 29 | @@ -828,7 +828,11 @@ cryptodev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg_) |
| 30 | fd = clonefd(filp); |
| 31 | ret = put_user(fd, p); |
| 32 | if (unlikely(ret)) { |
| 33 | +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)) |
| 34 | sys_close(fd); |
| 35 | +#else |
| 36 | + ksys_close(fd); |
| 37 | +#endif |
| 38 | return ret; |
| 39 | } |
| 40 | return ret; |
| 41 | -- |
| 42 | 2.7.4 |
| 43 | |