From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937289AbdJQSKh (ORCPT ); Tue, 17 Oct 2017 14:10:37 -0400 Received: from mail-qt0-f181.google.com ([209.85.216.181]:50659 "EHLO mail-qt0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937276AbdJQSKg (ORCPT ); Tue, 17 Oct 2017 14:10:36 -0400 X-Google-Smtp-Source: ABhQp+SsVuiqVK+/j/fHH8QIfJjZgqcum1jiIYWnvAtA2i5lG1t3CyV2ppLaEgQrhzN/z40BIXVEjg== Date: Tue, 17 Oct 2017 14:10:34 -0400 From: Sean Paul To: Jeffy Chen Cc: linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com, heiko@sntech.de, briannorris@chromium.org, rjw@rjwysocki.net, dianders@chromium.org, tfiga@chromium.org, broonie@kernel.org, seanpaul@chromium.org, Mark Yao , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, David Airlie , linux-arm-kernel@lists.infradead.org Subject: Re: [RFC PATCH v4 4/8] drm/rockchip: dw_hdmi: Fix error handling path Message-ID: <20171017181034.tsplfsmq7vi4uhmo@art_vandelay> References: <20171017101624.12506-1-jeffy.chen@rock-chips.com> <20171017101624.12506-5-jeffy.chen@rock-chips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171017101624.12506-5-jeffy.chen@rock-chips.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 17, 2017 at 06:16:20PM +0800, Jeffy Chen wrote: > Add missing clk_disable_unprepare() in bind()'s error handling path. This also isn't disabled in unbind(), is that intentional? > > Fixes: 12b9f204e804 ("drm: bridge/dw_hdmi: add rockchip rk3288 support") > Signed-off-by: Jeffy Chen > --- > > Changes in v4: None > Changes in v3: None > Changes in v2: None > > drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c > index 1eb02a82fd91..582283da7861 100644 > --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c > +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c > @@ -383,8 +383,10 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, > * If dw_hdmi_bind() fails we'll never call dw_hdmi_unbind(), > * which would have called the encoder cleanup. Do it manually. > */ > - if (ret) > + if (ret) { > drm_encoder_cleanup(encoder); > + clk_disable_unprepare(hdmi->vpll_clk); Same comment with respect to rockchip_hdmi_parse_dt(). This bug would have probably been avoided if the contents of rockchip_hdmi_parse_dt() were inline with dw_hdmi_rockchip_bind(), since then it's obvious what needs to be cleaned up. Sean > + } > > return ret; > } > -- > 2.11.0 > > -- Sean Paul, Software Engineer, Google / Chromium OS