Ignore:
Timestamp:
Apr 21, 2017, 4:28:29 AM (3 months ago)
Author:
brainslayer
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-3.18/arch/metag/include/asm/uaccess.h

    r30910 r31885  
    193193#define strlen_user(str) strnlen_user(str, 32767)
    194194
    195 extern unsigned long __must_check __copy_user_zeroing(void *to,
    196                                                       const void __user *from,
    197                                                       unsigned long n);
     195extern unsigned long raw_copy_from_user(void *to, const void __user *from,
     196                                        unsigned long n);
    198197
    199198static inline unsigned long
    200199copy_from_user(void *to, const void __user *from, unsigned long n)
    201200{
     201        unsigned long res = n;
    202202        if (likely(access_ok(VERIFY_READ, from, n)))
    203                 return __copy_user_zeroing(to, from, n);
    204         memset(to, 0, n);
    205         return n;
    206 }
    207 
    208 #define __copy_from_user(to, from, n) __copy_user_zeroing(to, from, n)
     203                res = raw_copy_from_user(to, from, n);
     204        if (unlikely(res))
     205                memset(to + (n - res), 0, res);
     206        return res;
     207}
     208
     209#define __copy_from_user(to, from, n) raw_copy_from_user(to, from, n)
    209210#define __copy_from_user_inatomic __copy_from_user
    210211
Note: See TracChangeset for help on using the changeset viewer.