lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 19 Jul 2016 11:30:15 +0000
From:	Wei Yongjun <weiyj_lk@....com>
To:	Xinliang Liu <z.liuxinliang@...ilicon.com>,
	Xinwei Kong <kong.kongxinwei@...ilicon.com>,
	Chen Feng <puck.chen@...ilicon.com>,
	David Airlie <airlied@...ux.ie>,
	Wei Yongjun <yongjun_wei@...ndmicro.com.cn>,
	Daniel Vetter <daniel.vetter@...ll.ch>,
	Archit Taneja <architt@...eaurora.org>
Cc:	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH -next] drm/hisilicon: Fix error handling of ade_power_up()

From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>

Fix the reset_control_deassert() fail and clk_prepare_enable() fail
error handling of ade_power_up().

Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
index c3707d4..e2bd1e6 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
@@ -258,18 +258,24 @@ static int ade_power_up(struct ade_hw_ctx *ctx)
 	ret = reset_control_deassert(ctx->reset);
 	if (ret) {
 		DRM_ERROR("failed to deassert reset\n");
-		return ret;
+		goto err_reset;
 	}
 
 	ret = clk_prepare_enable(ctx->ade_core_clk);
 	if (ret) {
 		DRM_ERROR("failed to enable ade_core_clk (%d)\n", ret);
-		return ret;
+		goto err_prepare_enable;
 	}
 
 	ade_init(ctx);
 	ctx->power_on = true;
 	return 0;
+
+err_prepare_enable:
+	reset_control_assert(ctx->reset);
+err_reset:
+	clk_disable_unprepare(ctx->media_noc_clk);
+	return ret;
 }
 
 static void ade_power_down(struct ade_hw_ctx *ctx)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ