Skip to contentSkip to conversation

hppfs: hppfs_read_file() may return -ERROR

PATCH New Roel Kluin 1 participant 1 message Mar 3, 2009

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 hppfs: hppfs_read_file() may return -ERROR

FYI: hppfs_read_file() is at: vi fs/hppfs/hppfs.c +212 ------------------------------>8-------------8<--------------------------------- 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.

---

fs/hppfs/hppfs.c +6 -1
index b278f7f..a5089a6 100644
@@ -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;
 	}