]> err.no Git - linux-2.6/blobdiff - security/seclvl.c
[PATCH] Clean up struct flock64 definitions
[linux-2.6] / security / seclvl.c
index 8a0ab0d7949e048a05c6cbe3da265f0246e857bc..96b1f2122f67bdac673a18fab792ea56e8d236ab 100644 (file)
@@ -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;
 }
 
 /**
@@ -321,7 +321,7 @@ plaintext_to_sha1(unsigned char *hash, const char *plaintext, int len)
                              "bytes.\n", len, PAGE_SIZE);
                return -ENOMEM;
        }
-       tfm = crypto_alloc_tfm("sha1", 0);
+       tfm = crypto_alloc_tfm("sha1", CRYPTO_TFM_REQ_MAY_SLEEP);
        if (tfm == NULL) {
                seclvl_printk(0, KERN_ERR,
                              "Failed to load transform for SHA1\n");