From a172ee2a18b715a6de9b8e914aecd8414a4f3b2d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 26 Apr 2003 23:04:22 +0000 Subject: [PATCH] MFL: Don't install irq handler unless the driver has been initialized. --- bsd-core/drm_dma.c | 3 +++ bsd/drm_dma.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/bsd-core/drm_dma.c b/bsd-core/drm_dma.c index 526faee2..10c26e37 100644 --- a/bsd-core/drm_dma.c +++ b/bsd-core/drm_dma.c @@ -160,6 +160,9 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) if ( !irq ) return DRM_ERR(EINVAL); + if (dev->dev_private == NULL) + return DRM_ERR(EINVAL); + DRM_LOCK; if ( dev->irq ) { DRM_UNLOCK; diff --git a/bsd/drm_dma.h b/bsd/drm_dma.h index 526faee2..10c26e37 100644 --- a/bsd/drm_dma.h +++ b/bsd/drm_dma.h @@ -160,6 +160,9 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) if ( !irq ) return DRM_ERR(EINVAL); + if (dev->dev_private == NULL) + return DRM_ERR(EINVAL); + DRM_LOCK; if ( dev->irq ) { DRM_UNLOCK;