diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-04-02 19:57:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-02 22:04:53 -0400 |
commit | 880fe76ee6f38eda82e9f3de9a7a206dfd1bab9d (patch) | |
tree | b5f5d085e73bdf352a9878e622d151f98bac6607 /fs | |
parent | 695f6ae0dcea3dd83bfbb9634ff067f780649ba8 (diff) |
hppfs: hppfs_read_file() may return -ERROR
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/hppfs/hppfs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c index b278f7f52024..a5089a6dd67a 100644 --- a/fs/hppfs/hppfs.c +++ b/fs/hppfs/hppfs.c | |||
@@ -280,7 +280,12 @@ static ssize_t hppfs_read(struct file *file, char __user *buf, size_t count, | |||
280 | "errno = %d\n", err); | 280 | "errno = %d\n", err); |
281 | return err; | 281 | return err; |
282 | } | 282 | } |
283 | count = hppfs_read_file(hppfs->host_fd, buf, count); | 283 | err = hppfs_read_file(hppfs->host_fd, buf, count); |
284 | if (err < 0) { | ||
285 | printk(KERN_ERR "hppfs_read: read failed: %d\n", err); | ||
286 | return err; | ||
287 | } | ||
288 | count = err; | ||
284 | if (count > 0) | 289 | if (count > 0) |
285 | *ppos += count; | 290 | *ppos += count; |
286 | } | 291 | } |