aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-04-29 01:27:34 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-20 15:15:03 -0700
commit70f2817a43c89b784dc2ec3d06ba5bf3064f8235 (patch)
tree210bbd16599d4e402051e4ec30c82e70b8b427ef /security
parent6c1852a08e444a2e66367352a99c0e93c8bf3e97 (diff)
downloadkernel_replicant_linux-70f2817a43c89b784dc2ec3d06ba5bf3064f8235.tar.gz
kernel_replicant_linux-70f2817a43c89b784dc2ec3d06ba5bf3064f8235.tar.bz2
kernel_replicant_linux-70f2817a43c89b784dc2ec3d06ba5bf3064f8235.zip
[PATCH] sysfs: (rest) if show/store is missing return -EIO
sysfs: fix the rest of the kernel so if an attribute doesn't implement show or store method read/write will return -EIO instead of 0 or -EINVAL or -EPERM. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'security')
-rw-r--r--security/seclvl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/seclvl.c b/security/seclvl.c
index 8a0ab0d7949e..c8e87b22c9bd 100644
--- a/security/seclvl.c
+++ b/security/seclvl.c
@@ -155,7 +155,7 @@ seclvl_attr_store(struct kobject *kobj,
struct seclvl_obj *obj = container_of(kobj, struct seclvl_obj, kobj);
struct seclvl_attribute *attribute =
container_of(attr, struct seclvl_attribute, attr);
- return (attribute->store ? attribute->store(obj, buf, len) : 0);
+ return attribute->store ? attribute->store(obj, buf, len) : -EIO;
}
static ssize_t
@@ -164,7 +164,7 @@ seclvl_attr_show(struct kobject *kobj, struct attribute *attr, char *buf)
struct seclvl_obj *obj = container_of(kobj, struct seclvl_obj, kobj);
struct seclvl_attribute *attribute =
container_of(attr, struct seclvl_attribute, attr);
- return (attribute->show ? attribute->show(obj, buf) : 0);
+ return attribute->show ? attribute->show(obj, buf) : -EIO;
}
/**