]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - security/integrity/ima/ima_crypto.c
integrity: ima scatterlist bug fix
[mv-sheeva.git] / security / integrity / ima / ima_crypto.c
index c2a46e40999d3b2a9ed24c1285ce60c925d90cc9..50d572b74caff78b157f9c713e6148d299b3c387 100644 (file)
@@ -68,7 +68,7 @@ int ima_calc_hash(struct file *file, char *digest)
                        break;
                }
                offset += rbuf_len;
-               sg_set_buf(sg, rbuf, rbuf_len);
+               sg_init_one(sg, rbuf, rbuf_len);
 
                rc = crypto_hash_update(&desc, sg, rbuf_len);
                if (rc)
@@ -95,7 +95,7 @@ int ima_calc_template_hash(int template_len, void *template, char *digest)
        if (rc != 0)
                return rc;
 
-       sg_set_buf(sg, template, template_len);
+       sg_init_one(sg, template, template_len);
        rc = crypto_hash_update(&desc, sg, template_len);
        if (!rc)
                rc = crypto_hash_final(&desc, digest);