From: Fergus James HENDERSON (fjh@munta.cs.mu.OZ.AU)
Date: 10/02/92


From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: erroneous code in linux/fs/proc/mem.c
Date: 2 Oct 1992 20:34:50 GMT

The following code contains a bug:

> static int mem_lseek(struct inode * inode, struct file * file, off_t offset, int orig)
> {
> switch (orig) {
> case 0:
> file->f_pos = offset;
> return file->f_pos;
> case 1:
> file->f_pos += offset;
> return file->f_pos;
> default:
> return -EINVAL;
> }

This point is unreachable. So what is the following code supposed to do?

> if (file->f_pos < 0)
> return 0;
> return file->f_pos;
> }

This was from the sources to 0.98

-- 
Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
This .signature virus is a self-referential statement that is true - but 
you will only be able to consistently believe it if you copy it to your own
.signature file!