From ee5d2acd5ca1534f40e06d4f0d41a940b17beb54 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Tue, 6 Apr 2010 14:35:01 -0700 Subject: [PATCH] /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 Acked-by: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/mem.c | 5 ----- 1 file changed, 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) 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) { -- 2.20.1