From 6c1852a08e444a2e66367352a99c0e93c8bf3e97 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 29 Apr 2005 01:26:06 -0500 Subject: [PATCH] sysfs: (driver/block) if show/store is missing return -EIO sysfs: fix drivers/block so if an attribute doesn't implement show or store method read/write will return -EIO instead of 0 or -EINVAL. Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/block/genhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/block/genhd.c') diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c index 8bbe01d4b48..53f7d846b74 100644 --- a/drivers/block/genhd.c +++ b/drivers/block/genhd.c @@ -322,7 +322,7 @@ static ssize_t disk_attr_show(struct kobject *kobj, struct attribute *attr, struct gendisk *disk = to_disk(kobj); struct disk_attribute *disk_attr = container_of(attr,struct disk_attribute,attr); - ssize_t ret = 0; + ssize_t ret = -EIO; if (disk_attr->show) ret = disk_attr->show(disk,page); -- cgit v1.2.3