[Intel-gfx] [PATCH] drm/i915: don't use i915_driver_unload() to cleanup failed vblank init

Jeremy Kerr jeremy.kerr at canonical.com
Wed Nov 17 07:24:53 CET 2010

Currently, i915_driver_load calls i915_driver_unload if drm_vblank_init
fails. However, we have not yet fully initialised drm_i915_private (eg.
->hangcheck_timer), so we're calling unload from an inconsistent state.

This change uses the existing error path to do the cleanup instead, as
is used before and after the drm_vblank_init() call.

Also, as drm_vblank_init doesn't print any message on failure, add a
DRM_ERROR to explain what happened, as is done for the other error

Signed-off-by: Jeremy Kerr <jeremy.kerr at canonical.com>

 drivers/gpu/drm/i915/i915_dma.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 7a26f4d..80766b6 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -2043,8 +2043,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
 	ret = drm_vblank_init(dev, I915_NUM_PIPE);
 	if (ret) {
-		(void) i915_driver_unload(dev);
-		return ret;
+		DRM_ERROR("failed to init vblank\n");
+		goto out_workqueue_free;
 	/* Start out suspended */

More information about the Intel-gfx mailing list