drm: Fix further issues in drivers/char/drm/via_irq.c
authorJayachandran C <c.jayachandran@gmail.com>
Tue, 11 Apr 2006 06:18:28 +0000 (23:18 -0700)
committerDave Airlie <airlied@linux.ie>
Tue, 18 Apr 2006 11:04:48 +0000 (21:04 +1000)
Fix de-reference of 'dev_priv' before NULL check.

Signed-off-by: Jayachandran C. <c.jayachandran@gmail.com>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@osdl.org>
drivers/char/drm/via_irq.c

index 1228fa55355b84eb38badeabb8d444bb1b7a1b8d..c33d068cde19f459b712147f0261829a59708804 100644 (file)
@@ -196,7 +196,7 @@ via_driver_irq_wait(drm_device_t * dev, unsigned int irq, int force_sequence,
 {
        drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
        unsigned int cur_irq_sequence;
-       drm_via_irq_t *cur_irq = dev_priv->via_irqs;
+       drm_via_irq_t *cur_irq;
        int ret = 0;
        maskarray_t *masks;
        int real_irq;
@@ -223,7 +223,7 @@ via_driver_irq_wait(drm_device_t * dev, unsigned int irq, int force_sequence,
        }
 
        masks = dev_priv->irq_masks;
-       cur_irq += real_irq;
+       cur_irq = dev_priv->via_irqs + real_irq;
 
        if (masks[real_irq][2] && !force_sequence) {
                DRM_WAIT_ON(ret, cur_irq->irq_queue, 3 * DRM_HZ,
@@ -248,11 +248,12 @@ void via_driver_irq_preinstall(drm_device_t * dev)
 {
        drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
        u32 status;
-       drm_via_irq_t *cur_irq = dev_priv->via_irqs;
+       drm_via_irq_t *cur_irq;
        int i;
 
        DRM_DEBUG("driver_irq_preinstall: dev_priv: %p\n", dev_priv);
        if (dev_priv) {
+               cur_irq = dev_priv->via_irqs;
 
                dev_priv->irq_enable_mask = VIA_IRQ_VBLANK_ENABLE;
                dev_priv->irq_pending_mask = VIA_IRQ_VBLANK_PENDING;