linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/sun4i: Fix some error handling paths in 'sun4i_hdmi_bind()'
@ 2018-03-18 22:48 Christophe JAILLET
  2018-03-18 22:48 ` [PATCH 1/2] drm/sun4i: hdmi: Fix an error handling path " Christophe JAILLET
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Christophe JAILLET @ 2018-03-18 22:48 UTC (permalink / raw)
  To: maxime.ripard, airlied, wens
  Cc: dri-devel, linux-arm-kernel, linux-kernel, kernel-janitors,
	Christophe JAILLET

I've splitted these fixes into 2 patches becasue they do not fixe the same
commit.

Christophe JAILLET (2):
  drm/sun4i: hdmi: Fix an error handling path in 'sun4i_hdmi_bind()'
  drm/sun4i: hdmi: Fix another error handling path in
    'sun4i_hdmi_bind()'

 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
2.14.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] drm/sun4i: hdmi: Fix an error handling path in 'sun4i_hdmi_bind()'
  2018-03-18 22:48 [PATCH 0/2] drm/sun4i: Fix some error handling paths in 'sun4i_hdmi_bind()' Christophe JAILLET
@ 2018-03-18 22:48 ` Christophe JAILLET
  2018-03-18 22:48 ` [PATCH 2/2] drm/sun4i: hdmi: Fix another " Christophe JAILLET
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Christophe JAILLET @ 2018-03-18 22:48 UTC (permalink / raw)
  To: maxime.ripard, airlied, wens
  Cc: dri-devel, linux-arm-kernel, linux-kernel, kernel-janitors,
	Christophe JAILLET

If we can not allocate the HDMI encoder regmap, we still need to free some
resources before returning.

Fixes: 4b1c924b1fc1 ("drm/sun4i: hdmi: create a regmap for later use")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index 500b6fb3e028..d2839727bb0b 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -538,7 +538,8 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master,
 					     &sun4i_hdmi_regmap_config);
 	if (IS_ERR(hdmi->regmap)) {
 		dev_err(dev, "Couldn't create HDMI encoder regmap\n");
-		return PTR_ERR(hdmi->regmap);
+		ret = PTR_ERR(hdmi->regmap);
+		goto err_disable_mod_clk;
 	}
 
 	ret = sun4i_tmds_create(hdmi);
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] drm/sun4i: hdmi: Fix another error handling path in 'sun4i_hdmi_bind()'
  2018-03-18 22:48 [PATCH 0/2] drm/sun4i: Fix some error handling paths in 'sun4i_hdmi_bind()' Christophe JAILLET
  2018-03-18 22:48 ` [PATCH 1/2] drm/sun4i: hdmi: Fix an error handling path " Christophe JAILLET
@ 2018-03-18 22:48 ` Christophe JAILLET
  2018-03-19  2:17 ` [PATCH 0/2] drm/sun4i: Fix some error handling paths " Chen-Yu Tsai
  2018-03-20 10:53 ` Maxime Ripard
  3 siblings, 0 replies; 5+ messages in thread
From: Christophe JAILLET @ 2018-03-18 22:48 UTC (permalink / raw)
  To: maxime.ripard, airlied, wens
  Cc: dri-devel, linux-arm-kernel, linux-kernel, kernel-janitors,
	Christophe JAILLET

If we can not get the HDMI DDC clock, we still need to free some
resources before returning.

Fixes: 939d749ad664 ("drm/sun4i: hdmi: Add support for controller hardware variants")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index d2839727bb0b..fa4bcd092eaf 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -552,7 +552,8 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master,
 		hdmi->ddc_parent_clk = devm_clk_get(dev, "ddc");
 		if (IS_ERR(hdmi->ddc_parent_clk)) {
 			dev_err(dev, "Couldn't get the HDMI DDC clock\n");
-			return PTR_ERR(hdmi->ddc_parent_clk);
+			ret = PTR_ERR(hdmi->ddc_parent_clk);
+			goto err_disable_mod_clk;
 		}
 	} else {
 		hdmi->ddc_parent_clk = hdmi->tmds_clk;
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] drm/sun4i: Fix some error handling paths in 'sun4i_hdmi_bind()'
  2018-03-18 22:48 [PATCH 0/2] drm/sun4i: Fix some error handling paths in 'sun4i_hdmi_bind()' Christophe JAILLET
  2018-03-18 22:48 ` [PATCH 1/2] drm/sun4i: hdmi: Fix an error handling path " Christophe JAILLET
  2018-03-18 22:48 ` [PATCH 2/2] drm/sun4i: hdmi: Fix another " Christophe JAILLET
@ 2018-03-19  2:17 ` Chen-Yu Tsai
  2018-03-20 10:53 ` Maxime Ripard
  3 siblings, 0 replies; 5+ messages in thread
From: Chen-Yu Tsai @ 2018-03-19  2:17 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Maxime Ripard, David Airlie, dri-devel, linux-arm-kernel,
	linux-kernel, kernel-janitors

On Mon, Mar 19, 2018 at 6:48 AM, Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
> I've splitted these fixes into 2 patches becasue they do not fixe the same
> commit.
>
> Christophe JAILLET (2):
>   drm/sun4i: hdmi: Fix an error handling path in 'sun4i_hdmi_bind()'
>   drm/sun4i: hdmi: Fix another error handling path in
>     'sun4i_hdmi_bind()'

Reviewed-by: Chen-Yu Tsai <wens@csie.org>

for both patches.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] drm/sun4i: Fix some error handling paths in 'sun4i_hdmi_bind()'
  2018-03-18 22:48 [PATCH 0/2] drm/sun4i: Fix some error handling paths in 'sun4i_hdmi_bind()' Christophe JAILLET
                   ` (2 preceding siblings ...)
  2018-03-19  2:17 ` [PATCH 0/2] drm/sun4i: Fix some error handling paths " Chen-Yu Tsai
@ 2018-03-20 10:53 ` Maxime Ripard
  3 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2018-03-20 10:53 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: airlied, wens, dri-devel, linux-arm-kernel, linux-kernel,
	kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 303 bytes --]

On Sun, Mar 18, 2018 at 11:48:08PM +0100, Christophe JAILLET wrote:
> I've splitted these fixes into 2 patches becasue they do not fixe the same
> commit.

Applied, thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-03-20 10:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-18 22:48 [PATCH 0/2] drm/sun4i: Fix some error handling paths in 'sun4i_hdmi_bind()' Christophe JAILLET
2018-03-18 22:48 ` [PATCH 1/2] drm/sun4i: hdmi: Fix an error handling path " Christophe JAILLET
2018-03-18 22:48 ` [PATCH 2/2] drm/sun4i: hdmi: Fix another " Christophe JAILLET
2018-03-19  2:17 ` [PATCH 0/2] drm/sun4i: Fix some error handling paths " Chen-Yu Tsai
2018-03-20 10:53 ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).