提交 fb223c32 编写于 作者: J Jonathan Corbet 提交者: Herbert Xu

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: NJonathan Corbet <corbet@lwn.net>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 5db017aa
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册