diff options
author | Doug Ledford <dledford@redhat.com> | 2015-09-25 10:46:07 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-09-25 10:46:07 -0400 |
commit | a99c59c0accea388f83ea651e90c814aeac04785 (patch) | |
tree | 1d102927807aa7c12a8a66cbb59d6560c6520645 /crypto/algapi.c | |
parent | c16e43ca0904ac1f8c20a2c007801d4d69bdb6f7 (diff) | |
parent | 733601f243cfd24755f2c120fb9f9ec284fa5ca1 (diff) | |
download | linux-crypto-a99c59c0accea388f83ea651e90c814aeac04785.tar.gz linux-crypto-a99c59c0accea388f83ea651e90c814aeac04785.zip |
Merge tag 'v4.3-rc2' into k.o/for-4.3-v1
Linux 4.3-rc2
Diffstat (limited to 'crypto/algapi.c')
-rw-r--r-- | crypto/algapi.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c index 3c079b7f..d130b41d 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -67,12 +67,22 @@ static int crypto_check_alg(struct crypto_alg *alg) return crypto_set_driver_name(alg); } +static void crypto_free_instance(struct crypto_instance *inst) +{ + if (!inst->alg.cra_type->free) { + inst->tmpl->free(inst); + return; + } + + inst->alg.cra_type->free(inst); +} + static void crypto_destroy_instance(struct crypto_alg *alg) { struct crypto_instance *inst = (void *)alg; struct crypto_template *tmpl = inst->tmpl; - tmpl->free(inst); + crypto_free_instance(inst); crypto_tmpl_put(tmpl); } @@ -481,7 +491,7 @@ void crypto_unregister_template(struct crypto_template *tmpl) hlist_for_each_entry_safe(inst, n, list, list) { BUG_ON(atomic_read(&inst->alg.cra_refcnt) != 1); - tmpl->free(inst); + crypto_free_instance(inst); } crypto_remove_final(&users); } @@ -892,7 +902,7 @@ out: } EXPORT_SYMBOL_GPL(crypto_enqueue_request); -void *__crypto_dequeue_request(struct crypto_queue *queue, unsigned int offset) +struct crypto_async_request *crypto_dequeue_request(struct crypto_queue *queue) { struct list_head *request; @@ -907,14 +917,7 @@ void *__crypto_dequeue_request(struct crypto_queue *queue, unsigned int offset) request = queue->list.next; list_del(request); - return (char *)list_entry(request, struct crypto_async_request, list) - - offset; -} -EXPORT_SYMBOL_GPL(__crypto_dequeue_request); - -struct crypto_async_request *crypto_dequeue_request(struct crypto_queue *queue) -{ - return __crypto_dequeue_request(queue, 0); + return list_entry(request, struct crypto_async_request, list); } EXPORT_SYMBOL_GPL(crypto_dequeue_request); |