diff options
author | Kim Phillips <kim.phillips@freescale.com> | 2011-12-12 15:59:10 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2011-12-20 02:20:01 -0500 |
commit | 0b2730d8d8b38e009607d5a094d48fcce73af547 (patch) | |
tree | 995bc7a5ed2246fedf936e5e254223a632faefce /drivers/crypto | |
parent | 741e8c2d8177eca656bc015ef83ab84d817edf8c (diff) |
crypto: talitos - fix bad kfree
Fix a kfree to an invalid address which causes an oops when running
on SEC v2.0 h/w (introduced in commit 702331b "crypto: talitos - add
hmac algorithms").
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/talitos.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 230509e9602b..d376cc7c5e8f 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c | |||
@@ -2626,8 +2626,10 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev, | |||
2626 | alg = &t_alg->algt.alg.hash.halg.base; | 2626 | alg = &t_alg->algt.alg.hash.halg.base; |
2627 | alg->cra_init = talitos_cra_init_ahash; | 2627 | alg->cra_init = talitos_cra_init_ahash; |
2628 | if (!(priv->features & TALITOS_FTR_HMAC_OK) && | 2628 | if (!(priv->features & TALITOS_FTR_HMAC_OK) && |
2629 | !strncmp(alg->cra_name, "hmac", 4)) | 2629 | !strncmp(alg->cra_name, "hmac", 4)) { |
2630 | kfree(t_alg); | ||
2630 | return ERR_PTR(-ENOTSUPP); | 2631 | return ERR_PTR(-ENOTSUPP); |
2632 | } | ||
2631 | if (!(priv->features & TALITOS_FTR_SHA224_HWINIT) && | 2633 | if (!(priv->features & TALITOS_FTR_SHA224_HWINIT) && |
2632 | (!strcmp(alg->cra_name, "sha224") || | 2634 | (!strcmp(alg->cra_name, "sha224") || |
2633 | !strcmp(alg->cra_name, "hmac(sha224)"))) { | 2635 | !strcmp(alg->cra_name, "hmac(sha224)"))) { |
@@ -2835,10 +2837,8 @@ static int talitos_probe(struct platform_device *ofdev) | |||
2835 | t_alg = talitos_alg_alloc(dev, &driver_algs[i]); | 2837 | t_alg = talitos_alg_alloc(dev, &driver_algs[i]); |
2836 | if (IS_ERR(t_alg)) { | 2838 | if (IS_ERR(t_alg)) { |
2837 | err = PTR_ERR(t_alg); | 2839 | err = PTR_ERR(t_alg); |
2838 | if (err == -ENOTSUPP) { | 2840 | if (err == -ENOTSUPP) |
2839 | kfree(t_alg); | ||
2840 | continue; | 2841 | continue; |
2841 | } | ||
2842 | goto err_out; | 2842 | goto err_out; |
2843 | } | 2843 | } |
2844 | 2844 | ||