aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2011-11-01 18:15:16 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2011-11-01 18:15:16 -0400
commitfb223c32b4d3ee593c8dce07e983680d06abe387 (patch)
tree80b88c2adde46fdd5608989929d54bddf38b513a /crypto
parent5db017aa2809c49ca0a43b0f3ed1267e6be60883 (diff)
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>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/crypto_user.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index 2abca780312d..0605a2bbba75 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)
44 44
45 down_read(&crypto_alg_sem); 45 down_read(&crypto_alg_sem);
46 46
47 if (list_empty(&crypto_alg_list))
48 return NULL;
49
50 list_for_each_entry(q, &crypto_alg_list, cra_list) { 47 list_for_each_entry(q, &crypto_alg_list, cra_list) {
51 int match = 0; 48 int match = 0;
52 49