Skip to content

Commit d805848

Browse files
herbertxDavid S. Miller
authored andcommitted
[CRYPTO] api: Explain the comparison on larval cra_name
This patch adds a comment to explain why we compare the cra_driver_name of the algorithm being registered against the cra_name of a larval as opposed to the cra_driver_name of the larval. In fact larvals have only one name, cra_name which is the name that was requested by the user. The test here is simply trying to find out whether the algorithm being registered can or can not satisfy the larval. Signed-off-by: Herbert Xu <[email protected]>
1 parent 7061378 commit d805848

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crypto/algapi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ static int __crypto_register_alg(struct crypto_alg *alg,
149149
if (crypto_is_larval(q)) {
150150
struct crypto_larval *larval = (void *)q;
151151

152+
/*
153+
* Check to see if either our generic name or
154+
* specific name can satisfy the name requested
155+
* by the larval entry q.
156+
*/
152157
if (strcmp(alg->cra_name, q->cra_name) &&
153158
strcmp(alg->cra_driver_name, q->cra_name))
154159
continue;

0 commit comments

Comments
 (0)