This is a note to let you know that I've just added the patch titled
drm/sun4i: Fix up error path cleanup for master bind function
to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
The filename of the patch is: drm-sun4i-fix-up-error-path-cleanup-for-master-bind-function.patch and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let stable@vger.kernel.org know about it.
From foo@baz Sun Mar 18 16:55:33 CET 2018
From: Chen-Yu Tsai wens@csie.org Date: Fri, 17 Feb 2017 11:13:25 +0800 Subject: drm/sun4i: Fix up error path cleanup for master bind function
From: Chen-Yu Tsai wens@csie.org
[ Upstream commit 9d56defb44b15427f4342c543a70fb7886fc06f5 ]
The master bind function calls numerous drm functions which initialize underlying structures. It also tries to bind the various components of the display pipeline, some of which may add additional drm objects.
This patch adds proper cleanup functions in the error path of the master bind function.
This requires the patch "drm/sun4i: Move drm_mode_config_cleanup call to main driver", which splits out drm_mode_config_cleanup from sun4i_framebuffer_free so we can call it separately.
Signed-off-by: Chen-Yu Tsai wens@csie.org Signed-off-by: Maxime Ripard maxime.ripard@free-electrons.com Signed-off-by: Sasha Levin alexander.levin@microsoft.com Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- drivers/gpu/drm/sun4i/sun4i_drv.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -145,7 +145,7 @@ static int sun4i_drv_bind(struct device ret = component_bind_all(drm->dev, drm); if (ret) { dev_err(drm->dev, "Couldn't bind all pipelines components\n"); - goto free_drm; + goto cleanup_mode_config; }
/* Create our layers */ @@ -153,7 +153,7 @@ static int sun4i_drv_bind(struct device if (IS_ERR(drv->layers)) { dev_err(drm->dev, "Couldn't create the planes\n"); ret = PTR_ERR(drv->layers); - goto free_drm; + goto cleanup_mode_config; }
/* Create our CRTC */ @@ -161,7 +161,7 @@ static int sun4i_drv_bind(struct device if (!drv->crtc) { dev_err(drm->dev, "Couldn't create the CRTC\n"); ret = -EINVAL; - goto free_drm; + goto cleanup_mode_config; } drm->irq_enabled = true;
@@ -173,7 +173,7 @@ static int sun4i_drv_bind(struct device if (IS_ERR(drv->fbdev)) { dev_err(drm->dev, "Couldn't create our framebuffer\n"); ret = PTR_ERR(drv->fbdev); - goto free_drm; + goto cleanup_mode_config; }
/* Enable connectors polling */ @@ -181,10 +181,16 @@ static int sun4i_drv_bind(struct device
ret = drm_dev_register(drm, 0); if (ret) - goto free_drm; + goto finish_poll;
return 0;
+finish_poll: + drm_kms_helper_poll_fini(drm); + sun4i_framebuffer_free(drm); +cleanup_mode_config: + drm_mode_config_cleanup(drm); + drm_vblank_cleanup(drm); free_drm: drm_dev_unref(drm); return ret;
Patches currently in stable-queue which might be from wens@csie.org are
queue-4.9/drm-sun4i-fix-up-error-path-cleanup-for-master-bind-function.patch queue-4.9/drm-sun4i-set-drm_crtc.port-to-the-underlying-tcon-s-output-port-node.patch queue-4.9/drm-sun4i-fix-tcon-clock-and-regmap-initialization-sequence.patch queue-4.9/clk-sunxi-ng-a33-add-offset-and-minimum-value-for-ddr1-pll-n-factor.patch
linux-stable-mirror@lists.linaro.org