Fix invalid pointer reference in BUFER_UNDERRUN callback for HDMI Audio.
authorAnand Saggi <anand.saggi@intel.com>
Wed, 29 Feb 2012 14:18:32 +0000 (06:18 -0800)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 3 Jul 2012 09:30:20 +0000 (12:30 +0300)
A Null pointer was being passed in the buffer underrun event, causing
tablet to crash as the hdmi audio data pointer is expected.

The scenario is reproducible when we plug HDMI during suspended mode
when audio is playing and try to wake up.
This patch will fix the above described issue.

ISSUE: HSD-206962

Signed-off-by: Mohan Kandra <mohan.b.kandra@intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
drivers/staging/mrst/drv/psb_irq.c

index 6d76932..815db73 100644 (file)
@@ -218,9 +218,14 @@ static void mdfld_pipe_hdmi_audio_underrun(struct drm_device *dev)
 {
        struct drm_psb_private *dev_priv =
                (struct drm_psb_private *) dev->dev_private;
+       void *had_pvt_data = dev_priv->had_pvt_data;
 
+       BUG_ON(had_pvt_data == NULL);
+
+       enum had_event_type event_type = HAD_EVENT_AUDIO_BUFFER_UNDERRUN;
        if (dev_priv->mdfld_had_event_callbacks)
-               (*dev_priv->mdfld_had_event_callbacks)(HAD_EVENT_AUDIO_BUFFER_UNDERRUN, NULL);
+               (*dev_priv->mdfld_had_event_callbacks)(event_type,
+                       had_pvt_data);
 }
 
 /**