]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/tilcdc: fix wrong error handling
authorDaniel Schultz <d.schultz@phytec.de>
Fri, 23 Sep 2016 10:52:49 +0000 (12:52 +0200)
committerJyri Sarha <jsarha@ti.com>
Fri, 23 Sep 2016 12:12:57 +0000 (15:12 +0300)
When 'component_bind_all' fails it should not try to unbind components
in the error handling. This will produce a null pointer kernel panic when
no component exist.

This patch changes the order of the error handling. Now, it will only
unbind components if the are bound. Otherwise, the module will jump to
an error label below.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
drivers/gpu/drm/tilcdc/tilcdc_drv.c

index 4b93cab911685e2c9e714e699d7493508705e686..a694977c32f4bfb88448aec5e604536db2f14a5d 100644 (file)
@@ -412,13 +412,13 @@ static int tilcdc_load(struct drm_device *dev, unsigned long flags)
 fail_vblank_cleanup:
        drm_vblank_cleanup(dev);
 
-fail_mode_config_cleanup:
-       drm_mode_config_cleanup(dev);
-
 fail_component_cleanup:
        if (priv->is_componentized)
                component_unbind_all(dev->dev, dev);
 
+fail_mode_config_cleanup:
+       drm_mode_config_cleanup(dev);
+
 fail_external_cleanup:
        tilcdc_remove_external_encoders(dev);