]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - crypto/blkcipher.c
crypto: use ERR_CAST
[mirror_ubuntu-bionic-kernel.git] / crypto / blkcipher.c
index a8d85a1d670e14dd388a1a38c03f25b80f61436e..e9e7244d5ef5bc4de642228d26933d97e75a8397 100644 (file)
@@ -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)