diff --git a/lib/strncpy_from_user.c b/lib/strncpy_from_user.c index 9d2683b521ae..2e03567e1e6b 100644 --- a/lib/strncpy_from_user.c +++ b/lib/strncpy_from_user.c @@ -44,7 +44,7 @@ static inline long do_strncpy_from_user(char *dst, const char __user *src, long ret = __get_user(c, src + res); if (ret) - return -ret; + return -EFAULT; dst[res] = c; if (!c) return res;