diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-10-21 07:56:42 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2012-10-24 09:10:56 -0400 |
commit | 3200da8d9afb3d0dc617515a2fe364d9d59ef523 (patch) | |
tree | fe2634c1a01ce9e6b4c81b8a58dd2ed7c810874d /drivers | |
parent | c12ab20b162c9414acadc18c6da6cfd3eea54b7b (diff) |
crypto: tegra - fix missing unlock on error case
Add the missing unlock on the error handling path in function
tegra_aes_get_random() and tegra_aes_rng_reset().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/crypto/tegra-aes.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/crypto/tegra-aes.c b/drivers/crypto/tegra-aes.c index 37185e6630cd..19adf1c7faa2 100644 --- a/drivers/crypto/tegra-aes.c +++ b/drivers/crypto/tegra-aes.c | |||
@@ -674,8 +674,10 @@ static int tegra_aes_get_random(struct crypto_rng *tfm, u8 *rdata, | |||
674 | mutex_lock(&aes_lock); | 674 | mutex_lock(&aes_lock); |
675 | 675 | ||
676 | ret = clk_prepare_enable(dd->aes_clk); | 676 | ret = clk_prepare_enable(dd->aes_clk); |
677 | if (ret) | 677 | if (ret) { |
678 | mutex_unlock(&aes_lock); | ||
678 | return ret; | 679 | return ret; |
680 | } | ||
679 | 681 | ||
680 | ctx->dd = dd; | 682 | ctx->dd = dd; |
681 | dd->ctx = ctx; | 683 | dd->ctx = ctx; |
@@ -759,8 +761,10 @@ static int tegra_aes_rng_reset(struct crypto_rng *tfm, u8 *seed, | |||
759 | dd->flags = FLAGS_ENCRYPT | FLAGS_RNG; | 761 | dd->flags = FLAGS_ENCRYPT | FLAGS_RNG; |
760 | 762 | ||
761 | ret = clk_prepare_enable(dd->aes_clk); | 763 | ret = clk_prepare_enable(dd->aes_clk); |
762 | if (ret) | 764 | if (ret) { |
765 | mutex_unlock(&aes_lock); | ||
763 | return ret; | 766 | return ret; |
767 | } | ||
764 | 768 | ||
765 | aes_set_key(dd); | 769 | aes_set_key(dd); |
766 | 770 | ||