[PATCH]crypto: Fix algorithm and driver duplicate registered

From: Youquan,Song
Date: Wed Nov 18 2009 - 11:55:53 EST


Current kernel, All the algorithms with same algorithm name and driver name
are registered.
But the proper behaviour should be only one algorithm be registered when
algorithm and driver name duplicate.

Signed-off-by: Youquan, Song <youquan.song@xxxxxxxxx>
---

diff --git a/crypto/algapi.c b/crypto/algapi.c
index f149b1c..a823fb2 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -207,8 +207,8 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg)
continue;
}

- if (!strcmp(q->cra_driver_name, alg->cra_name) ||
- !strcmp(q->cra_name, alg->cra_driver_name))
+ if (!strcmp(q->cra_driver_name, alg->cra_driver_name) &&
+ !strcmp(q->cra_name, alg->cra_name))
goto err;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/