diff options
author | Rasmus Villemoes <mail@rasmusvillemoes.dk> | 2013-06-05 13:09:39 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-06 15:54:08 -0400 |
commit | 71811f3271cd986e223be44830e5961056561ac3 (patch) | |
tree | 3056f805a67870d36c19a361cf805b44d33aae3e /drivers/char | |
parent | 29ddae2a40883640941932f73eb3d15535c3f4a2 (diff) |
drivers: char: mem: use IS_ERR_VALUE() in memory_lseek()
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>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/mem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 1ccbe9482faa..2ca6d7844ad9 100644 --- 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) | |||
745 | offset += file->f_pos; | 745 | offset += file->f_pos; |
746 | case SEEK_SET: | 746 | case SEEK_SET: |
747 | /* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */ | 747 | /* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */ |
748 | if ((unsigned long long)offset >= ~0xFFFULL) { | 748 | if (IS_ERR_VALUE((unsigned long long)offset)) { |
749 | ret = -EOVERFLOW; | 749 | ret = -EOVERFLOW; |
750 | break; | 750 | break; |
751 | } | 751 | } |