aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-04-06 17:35:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-04-07 11:38:04 -0400
commitee5d2acd5ca1534f40e06d4f0d41a940b17beb54 (patch)
tree4f4e06c3481835f67085ae79294829a2946f7df2 /drivers/char
parentb1dd3b2843b3b73b7fc2ee47d96310cd1c051371 (diff)
/dev/mem: allow rewinding
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>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/mem.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 47c8452f485f..9cdbadc68608 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -710,11 +710,6 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
710 switch (orig) { 710 switch (orig) {
711 case SEEK_CUR: 711 case SEEK_CUR:
712 offset += file->f_pos; 712 offset += file->f_pos;
713 if ((unsigned long long)offset <
714 (unsigned long long)file->f_pos) {
715 ret = -EOVERFLOW;
716 break;
717 }
718 case SEEK_SET: 713 case SEEK_SET:
719 /* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */ 714 /* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */
720 if ((unsigned long long)offset >= ~0xFFFULL) { 715 if ((unsigned long long)offset >= ~0xFFFULL) {