crypto: user - Fix rwsem leak in crypto_user
authorJonathan Corbet <corbet@lwn.net>
Tue, 1 Nov 2011 22:15:16 +0000 (09:15 +1100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 1 Nov 2011 22:15:16 +0000 (09:15 +1100)
commitfb223c32b4d3ee593c8dce07e983680d06abe387
tree80b88c2adde46fdd5608989929d54bddf38b513a
parent5db017aa2809c49ca0a43b0f3ed1267e6be60883
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>
crypto/crypto_user.c