drm: Fix irq install error handling
authorJoonyoung Shim <jy0922.shim@samsung.com>
Thu, 4 Aug 2011 05:41:00 +0000 (05:41 +0000)
committerDave Airlie <airlied@redhat.com>
Thu, 4 Aug 2011 13:39:09 +0000 (14:39 +0100)
The registered irq should be unregistered by free_irq() if
irq_postinstall() returns the error after request_irq() is called
successfully.

[airlied: add vga switcheroo disable]

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_irq.c

index 2022a5c966bb050d89084a699cc6e6ab8508a026..9be574fbcc2fbb1f24d906ed130afe4a209ccfae 100644 (file)
@@ -368,6 +368,9 @@ int drm_irq_install(struct drm_device *dev)
                mutex_lock(&dev->struct_mutex);
                dev->irq_enabled = 0;
                mutex_unlock(&dev->struct_mutex);
+               if (!drm_core_check_feature(dev, DRIVER_MODESET))
+                       vga_client_register(dev->pdev, NULL, NULL, NULL);
+               free_irq(drm_dev_to_irq(dev), dev);
        }
 
        return ret;