Commit a2479c40 authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Greg Kroah-Hartman

soc: qcom: gsbi: Fix error handling in gsbi_probe()

[ Upstream commit 8cd09a3d ]

If of_platform_populate() fails in gsbi_probe(),
gsbi->hclk is left undisabled.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: default avatarAndy Gross <andy.gross@linaro.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ce80ebf7
...@@ -138,7 +138,7 @@ static int gsbi_probe(struct platform_device *pdev) ...@@ -138,7 +138,7 @@ static int gsbi_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
void __iomem *base; void __iomem *base;
struct gsbi_info *gsbi; struct gsbi_info *gsbi;
int i; int i, ret;
u32 mask, gsbi_num; u32 mask, gsbi_num;
const struct crci_config *config = NULL; const struct crci_config *config = NULL;
...@@ -221,7 +221,10 @@ static int gsbi_probe(struct platform_device *pdev) ...@@ -221,7 +221,10 @@ static int gsbi_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, gsbi); platform_set_drvdata(pdev, gsbi);
return of_platform_populate(node, NULL, NULL, &pdev->dev); ret = of_platform_populate(node, NULL, NULL, &pdev->dev);
if (ret)
clk_disable_unprepare(gsbi->hclk);
return ret;
} }
static int gsbi_remove(struct platform_device *pdev) static int gsbi_remove(struct platform_device *pdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment