Skip to content

Commit

Permalink
crypto: user - Initialise match in crypto_alg_match
Browse files Browse the repository at this point in the history
We need to default match to 0 as otherwise it may lead to a false
positive.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Herbert Xu committed Oct 21, 2011
1 parent 573da62 commit e6ea64e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/crypto_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ struct crypto_dump_info {

static struct crypto_alg *crypto_alg_match(struct crypto_user_alg *p, int exact)
{
int match;
struct crypto_alg *q, *alg = NULL;

down_read(&crypto_alg_sem);
Expand All @@ -49,6 +48,7 @@ static struct crypto_alg *crypto_alg_match(struct crypto_user_alg *p, int exact)
return NULL;

list_for_each_entry(q, &crypto_alg_list, cra_list) {
int match = 0;

if ((q->cra_flags ^ p->cru_type) & p->cru_mask)
continue;
Expand Down

0 comments on commit e6ea64e

Please sign in to comment.