public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] drm/vmwgfx: fix a NULL dereference
@ 2016-01-28  9:06 Dan Carpenter
  2016-01-28  9:28 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-01-28  9:06 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter
  Cc: Thomas Hellstrom, Alex Deucher, Daniel Stone, Sinclair Yeh,
	dri-devel, linux-kernel, kernel-janitors

We dereference "eaction->event" inside the call to drm_send_event_locked()
so should hold off on setting it to NULL until afterward.

Fixes: fb740cf2492c ("drm: Create drm_send_event helpers")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
index e0edf14..37c305b 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
@@ -880,8 +880,8 @@ static void vmw_event_fence_action_seq_passed(struct vmw_fence_action *action)
 	}
 
 	list_del_init(&eaction->fpriv_head);
-	eaction->event = NULL;
 	drm_send_event_locked(dev, eaction->event);
+	eaction->event = NULL;
 	spin_unlock_irqrestore(&dev->event_lock, irq_flags);
 }
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-28  9:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-28  9:06 [patch] drm/vmwgfx: fix a NULL dereference Dan Carpenter
2016-01-28  9:28 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox