Messages in this thread Patch in this message | | | Date | Tue, 1 Nov 2011 16:08:37 -0600 | From | Jonathan Corbet <> | Subject | [PATCH] crypto: 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>
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c index 2abca78..0605a2b 100644 --- a/crypto/crypto_user.c +++ b/crypto/crypto_user.c @@ -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;
| |