Skip to content

Commit 8f03598

Browse files
author
Al Viro
committed
blackfin: fix copy_from_user()
Cc: [email protected] Signed-off-by: Al Viro <[email protected]>
1 parent 917400c commit 8f03598

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

arch/blackfin/include/asm/uaccess.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,12 @@ static inline int bad_user_access_length(void)
171171
static inline unsigned long __must_check
172172
copy_from_user(void *to, const void __user *from, unsigned long n)
173173
{
174-
if (access_ok(VERIFY_READ, from, n))
174+
if (likely(access_ok(VERIFY_READ, from, n))) {
175175
memcpy(to, (const void __force *)from, n);
176-
else
177-
return n;
178-
return 0;
176+
return 0;
177+
}
178+
memset(to, 0, n);
179+
return n;
179180
}
180181

181182
static inline unsigned long __must_check

0 commit comments

Comments
 (0)