X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=crypto%2Flrw.c;h=9d52e580d10a4d34b5117f801f98cf6bd4249b5c;hb=75529219373e53042fc46c86d991125e616f42dd;hp=b4105080ac7aa9d5886ea28772cfea6101197d27;hpb=bd0561c9d8dcbf21cd9aa46c416bbf6a3a12e4b1;p=linux-2.6 diff --git a/crypto/lrw.c b/crypto/lrw.c index b4105080ac..9d52e580d1 100644 --- a/crypto/lrw.c +++ b/crypto/lrw.c @@ -228,15 +228,20 @@ static void exit_tfm(struct crypto_tfm *tfm) crypto_free_cipher(ctx->child); } -static struct crypto_instance *alloc(void *param, unsigned int len) +static struct crypto_instance *alloc(struct rtattr **tb) { struct crypto_instance *inst; struct crypto_alg *alg; + int err; + + err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_BLKCIPHER); + if (err) + return ERR_PTR(err); - alg = crypto_get_attr_alg(param, len, CRYPTO_ALG_TYPE_CIPHER, - CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_ASYNC); + alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, + CRYPTO_ALG_TYPE_MASK); if (IS_ERR(alg)) - return ERR_PTR(PTR_ERR(alg)); + return ERR_CAST(alg); inst = crypto_alloc_instance("lrw", alg); if (IS_ERR(inst))