[PATCH:xf86-intel-video] Add NULL checking for drawable in sna_dri2_flip_event

Submitted by Lim Siew Hoon on Feb. 5, 2016, 8:50 a.m.

Details

Message ID 1454662222-20462-1-git-send-email-siew.hoon.lim@intel.com
State New
Headers show
Series "Add NULL checking for drawable in sna_dri2_flip_event" ( rev: 2 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Lim Siew Hoon Feb. 5, 2016, 8:50 a.m.
The last flip complete signal may happen after the
sna_dri2_destroy_window function has been called. This
leads to calling frame_swap_complete with a null flip
drawable. So check for that and handle accordingly.

Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
Reviewed-by: Bob Paauwe <bob.j.paauwe@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 src/sna/sna_dri2.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 33cf3d9..764a824 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -2874,6 +2874,10 @@  static void sna_dri2_flip_event(struct sna_dri2_event *flip)
 	case FLIP_THROTTLE:
 		if (flip->signal) {
 			DBG(("%s: triple buffer swap complete, unblocking client\n", __FUNCTION__));
+			if(flip->draw == NULL) {
+				sna_dri2_event_free(flip);
+				break;
+			}
 			frame_swap_complete(flip, DRI2_FLIP_COMPLETE);
 		}
 	case FLIP_COMPLETE:

Comments

On Fri, Feb 05, 2016 at 04:50:22PM +0800, Lim Siew Hoon wrote:
> The last flip complete signal may happen after the
> sna_dri2_destroy_window function has been called. This
> leads to calling frame_swap_complete with a null flip
> drawable. So check for that and handle accordingly.

Treating the symptom and not the cause.
-Chris