Skip to content

Commit

Permalink
blackfin: fix copy_from_user()
Browse files Browse the repository at this point in the history
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Sep 13, 2016
1 parent 917400c commit 8f03598
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions arch/blackfin/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,12 @@ static inline int bad_user_access_length(void)
static inline unsigned long __must_check
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))) {
memcpy(to, (const void __force *)from, n);
else
return n;
return 0;
return 0;
}
memset(to, 0, n);
return n;
}

static inline unsigned long __must_check
Expand Down

0 comments on commit 8f03598

Please sign in to comment.