Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81667e9c authored by Dan Carpenter's avatar Dan Carpenter Committed by Boris Brezillon
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent edfee361
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -273,8 +273,10 @@ int mtk_ecc_enable(struct mtk_ecc *ecc, struct mtk_ecc_config *config)
	mtk_ecc_wait_idle(ecc, op);

	ret = mtk_ecc_config(ecc, config);
	if (ret)
	if (ret) {
		mutex_unlock(&ecc->lock);
		return ret;
	}

	if (config->mode != ECC_NFI_MODE || op != ECC_ENCODE) {
		init_completion(&ecc->done);