summaryrefslogtreecommitdiff
path: root/crypto/blkcipher.c
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2013-03-11 12:54:48 +1100
committerJames Morris <james.l.morris@oracle.com>2013-03-11 12:54:48 +1100
commitae3fa576302633290c8d7c394c4098ec027bd8a1 (patch)
tree51a6d97b1ef57be7cb16c797497a610b9e1e1a5d /crypto/blkcipher.c
parentca10c662b0ec80db86864277a94889cc63bae958 (diff)
parenta390f39a9ef577563398884870a50eba558dfe49 (diff)
downloadlinux-crypto-ae3fa576302633290c8d7c394c4098ec027bd8a1.tar.gz
linux-crypto-ae3fa576302633290c8d7c394c4098ec027bd8a1.zip
Merge tag 'v3.9-rc2' into next
Sync with Linus. Linux 3.9-rc2
Diffstat (limited to 'crypto/blkcipher.c')
-rw-r--r--crypto/blkcipher.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c
index a8d85a1d..a79e7e9a 100644
--- a/crypto/blkcipher.c
+++ b/crypto/blkcipher.c
@@ -499,9 +499,9 @@ 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;
@@ -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)