summaryrefslogtreecommitdiff
path: root/crypto/crypto_user.c
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2012-01-29 23:39:22 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2012-02-05 15:12:25 +1100
commit05988527b416cbf793b1bd8273803b4d6a70333e (patch)
tree0e286c56258d46fa0c5af8c46e3e5ccaf2498a5e /crypto/crypto_user.c
parent48dfcf4fa1bec183fec32be0a52f7bbd82338acd (diff)
downloadlinux-crypto-05988527b416cbf793b1bd8273803b4d6a70333e.tar.gz
linux-crypto-05988527b416cbf793b1bd8273803b4d6a70333e.zip
crypto: In crypto_add_alg(), 'exact' wants to be initialized to 0
We declare 'exact' without initializing it and then do: [...] if (strlen(p->cru_driver_name)) exact = 1; if (priority && !exact) return -EINVAL; [...] If the first 'if' is not true, then the second will test an uninitialized 'exact'. As far as I can tell, what we want is for 'exact' to be initialized to 0 (zero/false). Signed-off-by: Jesper Juhl <jj@chaosbits.net> Acked-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/crypto_user.c')
-rw-r--r--crypto/crypto_user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index 3ba6ef50..3e61cc10 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -304,7 +304,7 @@ static int crypto_del_alg(struct sk_buff *skb, struct nlmsghdr *nlh,
static int crypto_add_alg(struct sk_buff *skb, struct nlmsghdr *nlh,
struct nlattr **attrs)
{
- int exact;
+ int exact = 0;
const char *name;
struct crypto_alg *alg;
struct crypto_user_alg *p = nlmsg_data(nlh);