Skip to contentSkip to conversation

drm/vmwgfx: fix a NULL dereference

PATCH In review Dan Carpenter 2 participants 2 messages Jan 28, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/vmwgfx: fix a NULL dereference

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")
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +1 -1
index e0edf14..37c305b 100644
@@ -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);
 }
 
#1 lore raw
Quoted 5 lines · Dan Carpenter

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")

Oh dear that's embarassing. Thanks for the patch, applied. -Daniel

Quoted 15 lines
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +1 -1
index e0edf14..37c305b 100644
@@ -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);
 }
 
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel