Commit 48b92777 authored by Jian Zhang's avatar Jian Zhang Committed by Inki Dae

drm/exynos/exynos7_drm_decon: free resources when clk_set_parent() failed.

In exynos7_decon_resume, When it fails, we must use clk_disable_unprepare()
to free resource that have been used.

Fixes: 6f83d208 ("drm/exynos: use DRM_DEV_ERROR to print out error
message")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarJian Zhang <zhangjian210@huawei.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent f4284724
...@@ -801,31 +801,40 @@ static int exynos7_decon_resume(struct device *dev) ...@@ -801,31 +801,40 @@ static int exynos7_decon_resume(struct device *dev)
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(dev, "Failed to prepare_enable the pclk [%d]\n", DRM_DEV_ERROR(dev, "Failed to prepare_enable the pclk [%d]\n",
ret); ret);
return ret; goto err_pclk_enable;
} }
ret = clk_prepare_enable(ctx->aclk); ret = clk_prepare_enable(ctx->aclk);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(dev, "Failed to prepare_enable the aclk [%d]\n", DRM_DEV_ERROR(dev, "Failed to prepare_enable the aclk [%d]\n",
ret); ret);
return ret; goto err_aclk_enable;
} }
ret = clk_prepare_enable(ctx->eclk); ret = clk_prepare_enable(ctx->eclk);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(dev, "Failed to prepare_enable the eclk [%d]\n", DRM_DEV_ERROR(dev, "Failed to prepare_enable the eclk [%d]\n",
ret); ret);
return ret; goto err_eclk_enable;
} }
ret = clk_prepare_enable(ctx->vclk); ret = clk_prepare_enable(ctx->vclk);
if (ret < 0) { if (ret < 0) {
DRM_DEV_ERROR(dev, "Failed to prepare_enable the vclk [%d]\n", DRM_DEV_ERROR(dev, "Failed to prepare_enable the vclk [%d]\n",
ret); ret);
return ret; goto err_vclk_enable;
} }
return 0; return 0;
err_vclk_enable:
clk_disable_unprepare(ctx->eclk);
err_eclk_enable:
clk_disable_unprepare(ctx->aclk);
err_aclk_enable:
clk_disable_unprepare(ctx->pclk);
err_pclk_enable:
return ret;
} }
#endif #endif
......
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