Skip to content

Commit 27b1342

Browse files
committed
crypto: api - Call crypto_alg_put in crypto_unregister_alg
Instead of calling cra_destroy by hand, call it through crypto_alg_put so that the correct unwinding functions are called through crypto_destroy_alg. Fixes: 3d6979b ("crypto: api - Add cra_type->destroy hook") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 5a06ef1 commit 27b1342

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

crypto/algapi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,7 @@ void crypto_unregister_alg(struct crypto_alg *alg)
464464
if (WARN_ON(refcount_read(&alg->cra_refcnt) != 1))
465465
return;
466466

467-
if (alg->cra_destroy)
468-
alg->cra_destroy(alg);
467+
crypto_alg_put(alg);
469468

470469
crypto_remove_final(&list);
471470
}

0 commit comments

Comments
 (0)