aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-05-25 20:45:22 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2010-05-25 20:45:22 -0400
commit7cc2835083aedfde42de02301005a5555e00c4b1 (patch)
tree5d9722dd33ec4dfbdca95cb977acca05e3bb8bb8 /drivers
parent026c8ec69d6077846ba8000b3301e8a62c702dc8 (diff)
crypto: mv_cesa - fixup error handling in mv_probe()
The error handling in mv_probe() was a bit messed up. There were some gotos to the wrong labels so it ended up releasing stuff that that hadn't been aquired and not releasing stuff that was meant to be released. I shuffled it around a bit to fix it and make it clearer. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/crypto/mv_cesa.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
index e095422b58dd..7d279e578df5 100644
--- a/drivers/crypto/mv_cesa.c
+++ b/drivers/crypto/mv_cesa.c
@@ -1055,20 +1055,20 @@ static int mv_probe(struct platform_device *pdev)
1055 cp->queue_th = kthread_run(queue_manag, cp, "mv_crypto"); 1055 cp->queue_th = kthread_run(queue_manag, cp, "mv_crypto");
1056 if (IS_ERR(cp->queue_th)) { 1056 if (IS_ERR(cp->queue_th)) {
1057 ret = PTR_ERR(cp->queue_th); 1057 ret = PTR_ERR(cp->queue_th);
1058 goto err_thread; 1058 goto err_unmap_sram;
1059 } 1059 }
1060 1060
1061 ret = request_irq(irq, crypto_int, IRQF_DISABLED, dev_name(&pdev->dev), 1061 ret = request_irq(irq, crypto_int, IRQF_DISABLED, dev_name(&pdev->dev),
1062 cp); 1062 cp);
1063 if (ret) 1063 if (ret)
1064 goto err_unmap_sram; 1064 goto err_thread;
1065 1065
1066 writel(SEC_INT_ACCEL0_DONE, cpg->reg + SEC_ACCEL_INT_MASK); 1066 writel(SEC_INT_ACCEL0_DONE, cpg->reg + SEC_ACCEL_INT_MASK);
1067 writel(SEC_CFG_STOP_DIG_ERR, cpg->reg + SEC_ACCEL_CFG); 1067 writel(SEC_CFG_STOP_DIG_ERR, cpg->reg + SEC_ACCEL_CFG);
1068 1068
1069 ret = crypto_register_alg(&mv_aes_alg_ecb); 1069 ret = crypto_register_alg(&mv_aes_alg_ecb);
1070 if (ret) 1070 if (ret)
1071 goto err_reg; 1071 goto err_irq;
1072 1072
1073 ret = crypto_register_alg(&mv_aes_alg_cbc); 1073 ret = crypto_register_alg(&mv_aes_alg_cbc);
1074 if (ret) 1074 if (ret)
@@ -1091,9 +1091,9 @@ static int mv_probe(struct platform_device *pdev)
1091 return 0; 1091 return 0;
1092err_unreg_ecb: 1092err_unreg_ecb:
1093 crypto_unregister_alg(&mv_aes_alg_ecb); 1093 crypto_unregister_alg(&mv_aes_alg_ecb);
1094err_thread: 1094err_irq:
1095 free_irq(irq, cp); 1095 free_irq(irq, cp);
1096err_reg: 1096err_thread:
1097 kthread_stop(cp->queue_th); 1097 kthread_stop(cp->queue_th);
1098err_unmap_sram: 1098err_unmap_sram:
1099 iounmap(cp->sram); 1099 iounmap(cp->sram);