Skip to content

Commit

Permalink
crypto: user - Fix rwsem leak in crypto_user
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Jonathan Corbet authored and herbertx committed Nov 1, 2011
1 parent 5db017a commit fb223c3
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions crypto/crypto_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ static struct crypto_alg *crypto_alg_match(struct crypto_user_alg *p, int exact)

down_read(&crypto_alg_sem);

if (list_empty(&crypto_alg_list))
return NULL;

list_for_each_entry(q, &crypto_alg_list, cra_list) {
int match = 0;

Expand Down

0 comments on commit fb223c3

Please sign in to comment.