projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
29ddae2
)
drivers: char: mem: use IS_ERR_VALUE() in memory_lseek()
author
Rasmus Villemoes
<mail@rasmusvillemoes.dk>
Wed, 5 Jun 2013 17:09:39 +0000
(17:09 +0000)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 6 Jun 2013 19:54:08 +0000
(12:54 -0700)
Use IS_ERR_VALUE() instead of comparing the new offset to a hard-coded
value of -MAX_ERRNO (which is also off-by-one due to the use of ~
instead of -).
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/mem.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/char/mem.c
b/drivers/char/mem.c
index 1ccbe9482faa5dbc3930478a17f493781849f161..2ca6d7844ad91d102c803116cfcfd0082d6e6518 100644
(file)
--- a/
drivers/char/mem.c
+++ b/
drivers/char/mem.c
@@
-745,7
+745,7
@@
static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
offset += file->f_pos;
case SEEK_SET:
/* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */
- if (
(unsigned long long)offset >= ~0xFFFULL
) {
+ if (
IS_ERR_VALUE((unsigned long long)offset)
) {
ret = -EOVERFLOW;
break;
}