X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=kernel%2Farch%2Fmetag%2Finclude%2Fasm%2Fuaccess.h;h=273e61225c277ae67ba28dfae4ef9123e3ef34a9;hb=52f993b8e89487ec9ee15a7fb4979e0f09a45b27;hp=8282cbce7e399a84488e675af0751341d24f0205;hpb=c189ccac5702322ed843fe17057035b7222a59b6;p=kvmfornfv.git diff --git a/kernel/arch/metag/include/asm/uaccess.h b/kernel/arch/metag/include/asm/uaccess.h index 8282cbce7..273e61225 100644 --- a/kernel/arch/metag/include/asm/uaccess.h +++ b/kernel/arch/metag/include/asm/uaccess.h @@ -204,8 +204,9 @@ extern unsigned long __must_check __copy_user_zeroing(void *to, static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n) { - if (access_ok(VERIFY_READ, from, n)) + if (likely(access_ok(VERIFY_READ, from, n))) return __copy_user_zeroing(to, from, n); + memset(to, 0, n); return n; }