hlist: drop the node parameter from iterators
[platform/adaptation/renesas_rcar/renesas_kernel.git] / crypto / blkcipher.c
index 4dd80c7..a79e7e9 100644 (file)
@@ -499,18 +499,18 @@ static int crypto_blkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)
 {
        struct crypto_report_blkcipher rblkcipher;
 
-       snprintf(rblkcipher.type, CRYPTO_MAX_ALG_NAME, "%s", "blkcipher");
-       snprintf(rblkcipher.geniv, CRYPTO_MAX_ALG_NAME, "%s",
-                alg->cra_blkcipher.geniv ?: "<default>");
+       strncpy(rblkcipher.type, "blkcipher", sizeof(rblkcipher.type));
+       strncpy(rblkcipher.geniv, alg->cra_blkcipher.geniv ?: "<default>",
+               sizeof(rblkcipher.geniv));
 
        rblkcipher.blocksize = alg->cra_blocksize;
        rblkcipher.min_keysize = alg->cra_blkcipher.min_keysize;
        rblkcipher.max_keysize = alg->cra_blkcipher.max_keysize;
        rblkcipher.ivsize = alg->cra_blkcipher.ivsize;
 
-       NLA_PUT(skb, CRYPTOCFGA_REPORT_BLKCIPHER,
-               sizeof(struct crypto_report_blkcipher), &rblkcipher);
-
+       if (nla_put(skb, CRYPTOCFGA_REPORT_BLKCIPHER,
+                   sizeof(struct crypto_report_blkcipher), &rblkcipher))
+               goto nla_put_failure;
        return 0;
 
 nla_put_failure:
@@ -588,18 +588,16 @@ struct crypto_instance *skcipher_geniv_alloc(struct crypto_template *tmpl,
        int err;
 
        algt = crypto_get_attr_type(tb);
-       err = PTR_ERR(algt);
        if (IS_ERR(algt))
-               return ERR_PTR(err);
+               return ERR_CAST(algt);
 
        if ((algt->type ^ (CRYPTO_ALG_TYPE_GIVCIPHER | CRYPTO_ALG_GENIV)) &
            algt->mask)
                return ERR_PTR(-EINVAL);
 
        name = crypto_attr_alg_name(tb[1]);
-       err = PTR_ERR(name);
        if (IS_ERR(name))
-               return ERR_PTR(err);
+               return ERR_CAST(name);
 
        inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL);
        if (!inst)