Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee5d2acd authored by Eric Dumazet's avatar Eric Dumazet Committed by Linus Torvalds
Browse files

/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: default avatarEric Dumazet <eric.dumazet@gmail.com>
Acked-by: default avatarWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b1dd3b28
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -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) {