Skip to contentSkip to conversation

drm/sun4i: Fix some error handling paths in 'sun4i_hdmi_bind()'

PATCH Applied Christophe JAILLET 3 participants 5 messages Mar 18, 2018 – Mar 20, 2018

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover drm/sun4i: Fix some error handling paths in 'sun4i_hdmi_bind()'

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(-)
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/2 drm/sun4i: hdmi: Fix an error handling path in 'sun4i_hdmi_bind()'

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")
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +2 -1
index 500b6fb3e028..d2839727bb0b 100644
@@ -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);
Signature · 1 line
2.14.1
#2 lore raw

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

In reply to 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")
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +2 -1
index d2839727bb0b..fa4bcd092eaf 100644
@@ -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;
Signature · 1 line
2.14.1
Reviewed-by on the v1 series
#3 lore raw
In reply to Christophe JAILLET
Quoted 7 lines · 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()'

for both patches.

#4 lore raw
In reply to Christophe JAILLET
Quoted 2 lines · Christophe JAILLET

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

Applied, thanks!
Maxime

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