projects
/
linux
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'regulator-4.21' into regulator-5.0
[linux]
/
lib
/
strnlen_user.c
diff --git
a/lib/strnlen_user.c
b/lib/strnlen_user.c
index
60d0bbd
..
1c1a1b0
100644
(file)
--- a/
lib/strnlen_user.c
+++ b/
lib/strnlen_user.c
@@
-114,10
+114,11
@@
long strnlen_user(const char __user *str, long count)
unsigned long max = max_addr - src_addr;
long retval;
unsigned long max = max_addr - src_addr;
long retval;
- user_access_begin();
- retval = do_strnlen_user(str, count, max);
- user_access_end();
- return retval;
+ if (user_access_begin(str, max)) {
+ retval = do_strnlen_user(str, count, max);
+ user_access_end();
+ return retval;
+ }
}
return 0;
}
}
return 0;
}