Skip to content

Commit b81e53f

Browse files
herbertxmehmetb0
authored andcommitted
crypto: api - Call crypto_alg_put in crypto_unregister_alg
BugLink: https://bugs.launchpad.net/bugs/2107212 [ Upstream commit 27b13425349e94ad77b174b032674097cab241c8 ] 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: 3d6979bf3bd5 ("crypto: api - Add cra_type->destroy hook") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
1 parent b1f697f commit b81e53f

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)