diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-04-29 02:27:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-20 18:15:03 -0400 |
commit | 70f2817a43c89b784dc2ec3d06ba5bf3064f8235 (patch) | |
tree | 210bbd16599d4e402051e4ec30c82e70b8b427ef /security | |
parent | 6c1852a08e444a2e66367352a99c0e93c8bf3e97 (diff) |
[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.c | 4 |
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, | |||
155 | struct seclvl_obj *obj = container_of(kobj, struct seclvl_obj, kobj); | 155 | struct seclvl_obj *obj = container_of(kobj, struct seclvl_obj, kobj); |
156 | struct seclvl_attribute *attribute = | 156 | struct seclvl_attribute *attribute = |
157 | container_of(attr, struct seclvl_attribute, attr); | 157 | container_of(attr, struct seclvl_attribute, attr); |
158 | return (attribute->store ? attribute->store(obj, buf, len) : 0); | 158 | return attribute->store ? attribute->store(obj, buf, len) : -EIO; |
159 | } | 159 | } |
160 | 160 | ||
161 | static ssize_t | 161 | static ssize_t |
@@ -164,7 +164,7 @@ seclvl_attr_show(struct kobject *kobj, struct attribute *attr, char *buf) | |||
164 | struct seclvl_obj *obj = container_of(kobj, struct seclvl_obj, kobj); | 164 | struct seclvl_obj *obj = container_of(kobj, struct seclvl_obj, kobj); |
165 | struct seclvl_attribute *attribute = | 165 | struct seclvl_attribute *attribute = |
166 | container_of(attr, struct seclvl_attribute, attr); | 166 | container_of(attr, struct seclvl_attribute, attr); |
167 | return (attribute->show ? attribute->show(obj, buf) : 0); | 167 | return attribute->show ? attribute->show(obj, buf) : -EIO; |
168 | } | 168 | } |
169 | 169 | ||
170 | /** | 170 | /** |