diff options
Diffstat (limited to 'lib/strnlen_user.c')
-rw-r--r-- | lib/strnlen_user.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/strnlen_user.c b/lib/strnlen_user.c index 2625943625d7..8e105ed4df12 100644 --- a/lib/strnlen_user.c +++ b/lib/strnlen_user.c | |||
@@ -45,8 +45,7 @@ static inline long do_strnlen_user(const char __user *src, unsigned long count, | |||
45 | src -= align; | 45 | src -= align; |
46 | max += align; | 46 | max += align; |
47 | 47 | ||
48 | if (unlikely(unsafe_get_user(c,(unsigned long __user *)src))) | 48 | unsafe_get_user(c, (unsigned long __user *)src, efault); |
49 | return 0; | ||
50 | c |= aligned_byte_mask(align); | 49 | c |= aligned_byte_mask(align); |
51 | 50 | ||
52 | for (;;) { | 51 | for (;;) { |
@@ -61,8 +60,7 @@ static inline long do_strnlen_user(const char __user *src, unsigned long count, | |||
61 | if (unlikely(max <= sizeof(unsigned long))) | 60 | if (unlikely(max <= sizeof(unsigned long))) |
62 | break; | 61 | break; |
63 | max -= sizeof(unsigned long); | 62 | max -= sizeof(unsigned long); |
64 | if (unlikely(unsafe_get_user(c,(unsigned long __user *)(src+res)))) | 63 | unsafe_get_user(c, (unsigned long __user *)(src+res), efault); |
65 | return 0; | ||
66 | } | 64 | } |
67 | res -= align; | 65 | res -= align; |
68 | 66 | ||
@@ -77,6 +75,7 @@ static inline long do_strnlen_user(const char __user *src, unsigned long count, | |||
77 | * Nope: we hit the address space limit, and we still had more | 75 | * Nope: we hit the address space limit, and we still had more |
78 | * characters the caller would have wanted. That's 0. | 76 | * characters the caller would have wanted. That's 0. |
79 | */ | 77 | */ |
78 | efault: | ||
80 | return 0; | 79 | return 0; |
81 | } | 80 | } |
82 | 81 | ||