Skip to content

Commit

Permalink
hppfs: hppfs_read_file() may return -ERROR
Browse files Browse the repository at this point in the history
hppfs_read_file() may return (ssize_t) -ENOMEM, or -EFAULT.  When stored
in size_t 'count', these errors will not be noticed, a large value will be
added to *ppos.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Roel Kluin authored and Linus Torvalds committed Apr 3, 2009
1 parent 695f6ae commit 880fe76
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/hppfs/hppfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,12 @@ static ssize_t hppfs_read(struct file *file, char __user *buf, size_t count,
"errno = %d\n", err);
return err;
}
count = hppfs_read_file(hppfs->host_fd, buf, count);
err = hppfs_read_file(hppfs->host_fd, buf, count);
if (err < 0) {
printk(KERN_ERR "hppfs_read: read failed: %d\n", err);
return err;
}
count = err;
if (count > 0)
*ppos += count;
}
Expand Down

0 comments on commit 880fe76

Please sign in to comment.