projects
/
linux-2.6-block.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'drm-amdkfd-fixes-2016-08-09' of git://people.freedesktop.org/~gabbayo...
[linux-2.6-block.git]
/
lib
/
strnlen_user.c
diff --git
a/lib/strnlen_user.c
b/lib/strnlen_user.c
index 2625943625d7fb229e6e2cf104e5d84c95246ffa..8e105ed4df12bb6bb0a170afff54d979c15d73c0 100644
(file)
--- 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,
src -= align;
max += align;
src -= align;
max += align;
- if (unlikely(unsafe_get_user(c,(unsigned long __user *)src)))
- return 0;
+ unsafe_get_user(c, (unsigned long __user *)src, efault);
c |= aligned_byte_mask(align);
for (;;) {
c |= aligned_byte_mask(align);
for (;;) {
@@
-61,8
+60,7
@@
static inline long do_strnlen_user(const char __user *src, unsigned long count,
if (unlikely(max <= sizeof(unsigned long)))
break;
max -= sizeof(unsigned long);
if (unlikely(max <= sizeof(unsigned long)))
break;
max -= sizeof(unsigned long);
- if (unlikely(unsafe_get_user(c,(unsigned long __user *)(src+res))))
- return 0;
+ unsafe_get_user(c, (unsigned long __user *)(src+res), efault);
}
res -= align;
}
res -= align;
@@
-77,6
+75,7
@@
static inline long do_strnlen_user(const char __user *src, unsigned long count,
* Nope: we hit the address space limit, and we still had more
* characters the caller would have wanted. That's 0.
*/
* Nope: we hit the address space limit, and we still had more
* characters the caller would have wanted. That's 0.
*/
+efault:
return 0;
}
return 0;
}