drm: sti: correctly cleanup CRTC and planes
authorBenjamin Gaignard <benjamin.gaignard@linaro.org>
Thu, 11 Dec 2014 12:35:29 +0000 (13:35 +0100)
committerBenjamin Gaignard <benjamin.gaignard@linaro.org>
Thu, 11 Dec 2014 13:00:19 +0000 (14:00 +0100)
When bind failed make sure that CRTC and planes are
completely clean up to avoid properties duplication.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
drivers/gpu/drm/sti/sti_drm_drv.c

index 223d93c3a05d8d7241ad05b669562d0a160af4fa..9ce7574ac8736385c2dcf123a4215cc3d270587c 100644 (file)
@@ -67,8 +67,12 @@ static int sti_drm_load(struct drm_device *dev, unsigned long flags)
        sti_drm_mode_config_init(dev);
 
        ret = component_bind_all(dev->dev, dev);
-       if (ret)
+       if (ret) {
+               drm_kms_helper_poll_fini(dev);
+               drm_mode_config_cleanup(dev);
+               kfree(private);
                return ret;
+       }
 
        drm_helper_disable_unused_functions(dev);