Skip to content

Commit

Permalink
ARM: compat: remove KERNEL_DS usage in sys_oabi_epoll_ctl()
Browse files Browse the repository at this point in the history
We no longer need to switch to KERNEL_DS mode in sys_oabi_epoll_ctl()
as we can use do_epoll_ctl() to avoid the additional copy.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
  • Loading branch information
Russell King committed Apr 21, 2020
1 parent 8f3d9f3 commit c281634
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions arch/arm/kernel/sys_oabi-compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,20 +253,15 @@ asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
{
struct oabi_epoll_event user;
struct epoll_event kernel;
mm_segment_t fs;
long ret;

if (op == EPOLL_CTL_DEL)
return sys_epoll_ctl(epfd, op, fd, NULL);
if (copy_from_user(&user, event, sizeof(user)))
if (ep_op_has_event(op) &&
copy_from_user(&user, event, sizeof(user)))
return -EFAULT;

kernel.events = user.events;
kernel.data = user.data;
fs = get_fs();
set_fs(KERNEL_DS);
ret = sys_epoll_ctl(epfd, op, fd, &kernel);
set_fs(fs);
return ret;

return do_epoll_ctl(epfd, op, fd, &kernel, false);
}

asmlinkage long sys_oabi_epoll_wait(int epfd,
Expand Down

0 comments on commit c281634

Please sign in to comment.