diff options
| author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2018-12-07 17:57:04 -0500 |
|---|---|---|
| committer | Andy Gross <andy.gross@linaro.org> | 2019-02-01 17:08:52 -0500 |
| commit | 8cd09a3dd3e176c62da67efcd477a44a8d87185e (patch) | |
| tree | 48e8731922d3bbcd09c836cc52c1588d65494e92 /drivers | |
| parent | baef1c90aac7e5bf13f0360a3b334825a23d31a1 (diff) | |
soc: qcom: gsbi: Fix error handling in gsbi_probe()
If of_platform_populate() fails in gsbi_probe(),
gsbi->hclk is left undisabled.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/soc/qcom/qcom_gsbi.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/soc/qcom/qcom_gsbi.c b/drivers/soc/qcom/qcom_gsbi.c index 09c669e70d63..038abc377fdb 100644 --- a/drivers/soc/qcom/qcom_gsbi.c +++ b/drivers/soc/qcom/qcom_gsbi.c | |||
| @@ -138,7 +138,7 @@ static int gsbi_probe(struct platform_device *pdev) | |||
| 138 | struct resource *res; | 138 | struct resource *res; |
| 139 | void __iomem *base; | 139 | void __iomem *base; |
| 140 | struct gsbi_info *gsbi; | 140 | struct gsbi_info *gsbi; |
| 141 | int i; | 141 | int i, ret; |
| 142 | u32 mask, gsbi_num; | 142 | u32 mask, gsbi_num; |
| 143 | const struct crci_config *config = NULL; | 143 | const struct crci_config *config = NULL; |
| 144 | 144 | ||
| @@ -221,7 +221,10 @@ static int gsbi_probe(struct platform_device *pdev) | |||
| 221 | 221 | ||
| 222 | platform_set_drvdata(pdev, gsbi); | 222 | platform_set_drvdata(pdev, gsbi); |
| 223 | 223 | ||
| 224 | return of_platform_populate(node, NULL, NULL, &pdev->dev); | 224 | ret = of_platform_populate(node, NULL, NULL, &pdev->dev); |
| 225 | if (ret) | ||
| 226 | clk_disable_unprepare(gsbi->hclk); | ||
| 227 | return ret; | ||
| 225 | } | 228 | } |
| 226 | 229 | ||
| 227 | static int gsbi_remove(struct platform_device *pdev) | 230 | static int gsbi_remove(struct platform_device *pdev) |
