Skip to content

Commit

Permalink
/dev/mem: allow rewinding
Browse files Browse the repository at this point in the history
commit dcefafb ("/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>
  • Loading branch information
Eric Dumazet authored and Linus Torvalds committed Apr 7, 2010
1 parent b1dd3b2 commit ee5d2ac
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/char/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ee5d2ac

Please sign in to comment.