From e1c44acc8cabda6b38864f25e809b306c4d2d790 Mon Sep 17 00:00:00 2001 From: Joonyoung Shim Date: Thu, 4 Aug 2011 05:41:00 +0000 Subject: [PATCH] drm: Fix irq install error handling 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 Signed-off-by: Kyungmin Park Signed-off-by: Dave Airlie --- drivers/gpu/drm/drm_irq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 2022a5c966bb..9be574fbcc2f 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -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; -- 2.20.1