/dev/mem: allow rewinding
authorEric Dumazet <eric.dumazet@gmail.com>
Tue, 6 Apr 2010 21:35:01 +0000 (14:35 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Apr 2010 15:38:04 +0000 (08:38 -0700)
commit dcefafb6 ("/dev/mem: dont allow seek to last page") inadvertently
disabled rewinding on /dev/mem.

This broke x86info for example.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/mem.c

index 47c8452f485fa6bcc03683754bb1432e8a082e2a..9cdbadc6860814476ad147283dc2ba2675539509 100644 (file)
@@ -710,11 +710,6 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
        switch (orig) {
        case SEEK_CUR:
                offset += file->f_pos;
-               if ((unsigned long long)offset <
-                   (unsigned long long)file->f_pos) {
-                       ret = -EOVERFLOW;
-                       break;
-               }
        case SEEK_SET:
                /* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */
                if ((unsigned long long)offset >= ~0xFFFULL) {