Commit 3200da8d authored by Wei Yongjun's avatar Wei Yongjun Committed by Herbert Xu

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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent c12ab20b
...@@ -674,8 +674,10 @@ static int tegra_aes_get_random(struct crypto_rng *tfm, u8 *rdata, ...@@ -674,8 +674,10 @@ static int tegra_aes_get_random(struct crypto_rng *tfm, u8 *rdata,
mutex_lock(&aes_lock); mutex_lock(&aes_lock);
ret = clk_prepare_enable(dd->aes_clk); ret = clk_prepare_enable(dd->aes_clk);
if (ret) if (ret) {
mutex_unlock(&aes_lock);
return ret; return ret;
}
ctx->dd = dd; ctx->dd = dd;
dd->ctx = ctx; dd->ctx = ctx;
...@@ -759,8 +761,10 @@ static int tegra_aes_rng_reset(struct crypto_rng *tfm, u8 *seed, ...@@ -759,8 +761,10 @@ static int tegra_aes_rng_reset(struct crypto_rng *tfm, u8 *seed,
dd->flags = FLAGS_ENCRYPT | FLAGS_RNG; dd->flags = FLAGS_ENCRYPT | FLAGS_RNG;
ret = clk_prepare_enable(dd->aes_clk); ret = clk_prepare_enable(dd->aes_clk);
if (ret) if (ret) {
mutex_unlock(&aes_lock);
return ret; return ret;
}
aes_set_key(dd); aes_set_key(dd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment