1 From ed999912da4455db0e65c3a3bd5b45c090a2493b Mon Sep 17 00:00:00 2001
2 From: Alexey Khoroshilov <khoroshilov@ispras.ru>
3 Date: Sat, 8 Dec 2018 01:57:04 +0300
4 Subject: soc: qcom: gsbi: Fix error handling in gsbi_probe()
6 [ Upstream commit 8cd09a3dd3e176c62da67efcd477a44a8d87185e ]
8 If of_platform_populate() fails in gsbi_probe(),
9 gsbi->hclk is left undisabled.
11 Found by Linux Driver Verification project (linuxtesting.org).
13 Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
14 Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
15 Signed-off-by: Andy Gross <andy.gross@linaro.org>
16 Signed-off-by: Sasha Levin <sashal@kernel.org>
18 drivers/soc/qcom/qcom_gsbi.c | 7 +++++--
19 1 file changed, 5 insertions(+), 2 deletions(-)
21 diff --git a/drivers/soc/qcom/qcom_gsbi.c b/drivers/soc/qcom/qcom_gsbi.c
22 index 09c669e70d63..038abc377fdb 100644
23 --- a/drivers/soc/qcom/qcom_gsbi.c
24 +++ b/drivers/soc/qcom/qcom_gsbi.c
25 @@ -138,7 +138,7 @@ static int gsbi_probe(struct platform_device *pdev)
28 struct gsbi_info *gsbi;
32 const struct crci_config *config = NULL;
34 @@ -221,7 +221,10 @@ static int gsbi_probe(struct platform_device *pdev)
36 platform_set_drvdata(pdev, gsbi);
38 - return of_platform_populate(node, NULL, NULL, &pdev->dev);
39 + ret = of_platform_populate(node, NULL, NULL, &pdev->dev);
41 + clk_disable_unprepare(gsbi->hclk);
45 static int gsbi_remove(struct platform_device *pdev)