Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Roel Kluin and committed by
Linus Torvalds
880fe76e 695f6ae0

+6 -1
+6 -1
fs/hppfs/hppfs.c
··· 280 280 "errno = %d\n", err); 281 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 289 if (count > 0) 285 290 *ppos += count; 286 291 }