Skip to content

Commit fb223c3

Browse files
Jonathan Corbetherbertx
authored andcommitted
crypto: user - Fix rwsem leak in crypto_user
The list_empty case in crypto_alg_match() will return without calling up_read() on crypto_alg_sem. We could do the "goto out" routine, but the function will clearly do the right thing with that test simply removed. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 5db017a commit fb223c3

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

‎crypto/crypto_user.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ static struct crypto_alg *crypto_alg_match(struct crypto_user_alg *p, int exact)
4444

4545
down_read(&crypto_alg_sem);
4646

47-
if (list_empty(&crypto_alg_list))
48-
return NULL;
49-
5047
list_for_each_entry(q, &crypto_alg_list, cra_list) {
5148
int match = 0;
5249

0 commit comments

Comments
 (0)