提交 81667e9c 编写于 作者: D Dan Carpenter 提交者: Boris Brezillon

mtd: nand: mtk: release lock on error path

We only want to hold the lock on the success path, not this error path.

Fixes: 7ec4a37c ("mtd: nand: mediatek: add support for different MTK NAND FLASH Controller IP")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
上级 edfee361
...@@ -273,8 +273,10 @@ int mtk_ecc_enable(struct mtk_ecc *ecc, struct mtk_ecc_config *config) ...@@ -273,8 +273,10 @@ int mtk_ecc_enable(struct mtk_ecc *ecc, struct mtk_ecc_config *config)
mtk_ecc_wait_idle(ecc, op); mtk_ecc_wait_idle(ecc, op);
ret = mtk_ecc_config(ecc, config); ret = mtk_ecc_config(ecc, config);
if (ret) if (ret) {
mutex_unlock(&ecc->lock);
return ret; return ret;
}
if (config->mode != ECC_NFI_MODE || op != ECC_ENCODE) { if (config->mode != ECC_NFI_MODE || op != ECC_ENCODE) {
init_completion(&ecc->done); init_completion(&ecc->done);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册