diff options
Diffstat (limited to 'lib/strnlen_user.c')
-rw-r--r-- | lib/strnlen_user.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/strnlen_user.c b/lib/strnlen_user.c index 60d0bbda8f5e..1c1a1b0e38a5 100644 --- a/lib/strnlen_user.c +++ b/lib/strnlen_user.c | |||
@@ -114,10 +114,11 @@ long strnlen_user(const char __user *str, long count) | |||
114 | unsigned long max = max_addr - src_addr; | 114 | unsigned long max = max_addr - src_addr; |
115 | long retval; | 115 | long retval; |
116 | 116 | ||
117 | user_access_begin(); | 117 | if (user_access_begin(str, max)) { |
118 | retval = do_strnlen_user(str, count, max); | 118 | retval = do_strnlen_user(str, count, max); |
119 | user_access_end(); | 119 | user_access_end(); |
120 | return retval; | 120 | return retval; |
121 | } | ||
121 | } | 122 | } |
122 | return 0; | 123 | return 0; |
123 | } | 124 | } |