Merge branches 'fixes', 'misc' and 'spectre' into for-next
[muen/linux.git] / arch / arm / kernel / sys_oabi-compat.c
index f0dd4b6ebb6330e5007e883d2ba2d099a4e1df94..40da0872170fca836d734b12257c63906d1e6b8f 100644 (file)
@@ -277,6 +277,7 @@ asmlinkage long sys_oabi_epoll_wait(int epfd,
                                    int maxevents, int timeout)
 {
        struct epoll_event *kbuf;
+       struct oabi_epoll_event e;
        mm_segment_t fs;
        long ret, err, i;
 
@@ -295,8 +296,11 @@ asmlinkage long sys_oabi_epoll_wait(int epfd,
        set_fs(fs);
        err = 0;
        for (i = 0; i < ret; i++) {
-               __put_user_error(kbuf[i].events, &events->events, err);
-               __put_user_error(kbuf[i].data,   &events->data,   err);
+               e.events = kbuf[i].events;
+               e.data = kbuf[i].data;
+               err = __copy_to_user(events, &e, sizeof(e));
+               if (err)
+                       break;
                events++;
        }
        kfree(kbuf);