* [PATCH] crypto: Fix rwsem leak in crypto_user
@ 2011-11-01 22:08 Jonathan Corbet
2011-11-01 22:16 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Corbet @ 2011-11-01 22:08 UTC (permalink / raw)
To: Herbert Xu; +Cc: Steffen Klassert, LKML
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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto: Fix rwsem leak in crypto_user
2011-11-01 22:08 [PATCH] crypto: Fix rwsem leak in crypto_user Jonathan Corbet
@ 2011-11-01 22:16 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2011-11-01 22:16 UTC (permalink / raw)
To: Jonathan Corbet; +Cc: Steffen Klassert, LKML
On Tue, Nov 01, 2011 at 04:08:37PM -0600, Jonathan Corbet wrote:
> 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>
Patch applied. Thanks a lot Jon!
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-01 22:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-01 22:08 [PATCH] crypto: Fix rwsem leak in crypto_user Jonathan Corbet
2011-11-01 22:16 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®