Skip to content

Commit

Permalink
mtd: rawnand: marvell: add missing clk_disable_unprepare() on error i…
Browse files Browse the repository at this point in the history
…n marvell_nfc_resume()

[ Upstream commit ae94c49 ]

Add clk_disable_unprepare() on error path in marvell_nfc_resume().

Fixes: bd9c3f9 ("mtd: rawnand: marvell: add suspend and resume hooks")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210601125814.3260364-1-yangyingliang@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yang Yingliang authored and gregkh committed Jul 14, 2021
1 parent f929d21 commit c183b55
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/mtd/nand/raw/marvell_nand.c
Expand Up @@ -3036,8 +3036,10 @@ static int __maybe_unused marvell_nfc_resume(struct device *dev)
return ret;

ret = clk_prepare_enable(nfc->reg_clk);
if (ret < 0)
if (ret < 0) {
clk_disable_unprepare(nfc->core_clk);
return ret;
}

/*
* Reset nfc->selected_chip so the next command will cause the timing
Expand Down

0 comments on commit c183b55

Please sign in to comment.