summaryrefslogtreecommitdiffstats
path: root/kernel/arch/hexagon
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/arch/hexagon')
-rw-r--r--kernel/arch/hexagon/include/asm/uaccess.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/arch/hexagon/include/asm/uaccess.h b/kernel/arch/hexagon/include/asm/uaccess.h
index f000a382b..f61cfb28e 100644
--- a/kernel/arch/hexagon/include/asm/uaccess.h
+++ b/kernel/arch/hexagon/include/asm/uaccess.h
@@ -103,7 +103,8 @@ static inline long hexagon_strncpy_from_user(char *dst, const char __user *src,
{
long res = __strnlen_user(src, n);
- /* return from strnlen can't be zero -- that would be rubbish. */
+ if (unlikely(!res))
+ return -EFAULT;
if (res > n) {
copy_from_user(dst, src, n);