stmmac: sanitize the rx coe and add the type-1 csum (v2)
[deliverable/linux.git] / crypto / shash.c
index 9100912716ae948fa57da13b9030a248f0460942..32067f47e6c7bfbeea673d039e7ad5bc2bf90492 100644 (file)
@@ -281,10 +281,10 @@ int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc)
        if (nbytes < min(sg->length, ((unsigned int)(PAGE_SIZE)) - offset)) {
                void *data;
 
-               data = crypto_kmap(sg_page(sg), 0);
+               data = kmap_atomic(sg_page(sg));
                err = crypto_shash_digest(desc, data + offset, nbytes,
                                          req->result);
-               crypto_kunmap(data, 0);
+               kunmap_atomic(data);
                crypto_yield(desc->flags);
        } else
                err = crypto_shash_init(desc) ?:
@@ -420,9 +420,9 @@ static int shash_compat_digest(struct hash_desc *hdesc, struct scatterlist *sg,
 
                desc->flags = hdesc->flags;
 
-               data = crypto_kmap(sg_page(sg), 0);
+               data = kmap_atomic(sg_page(sg));
                err = crypto_shash_digest(desc, data + offset, nbytes, out);
-               crypto_kunmap(data, 0);
+               kunmap_atomic(data);
                crypto_yield(desc->flags);
                goto out;
        }
@@ -534,9 +534,9 @@ static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg)
        rhash.blocksize = alg->cra_blocksize;
        rhash.digestsize = salg->digestsize;
 
-       NLA_PUT(skb, CRYPTOCFGA_REPORT_HASH,
-               sizeof(struct crypto_report_hash), &rhash);
-
+       if (nla_put(skb, CRYPTOCFGA_REPORT_HASH,
+                   sizeof(struct crypto_report_hash), &rhash))
+               goto nla_put_failure;
        return 0;
 
 nla_put_failure:
This page took 0.028902 seconds and 5 git commands to generate.