Skip to content

Commit 1dda680

Browse files
YoungJun Choairlied
authored andcommitted
drm: delete unconsumed pending event list in drm_events_release
When there are unconsumed pending events, the events are destroyed by calling destroy callback, but the events list are remained, because there is no list_del(). It is possible that the page flip request is handled after drm_events_release() is called and before drm_fb_release(). In this case a drm_pending_event is remained not freed. So exynos driver checks again to remove it in its post close routine. But the file_priv->event_list contains undeleted ones, this can make oops for accessing invalid memory. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
1 parent 06c5bf8 commit 1dda680

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎drivers/gpu/drm/drm_fops.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,10 @@ static void drm_events_release(struct drm_file *file_priv)
378378
}
379379

380380
/* Remove unconsumed events */
381-
list_for_each_entry_safe(e, et, &file_priv->event_list, link)
381+
list_for_each_entry_safe(e, et, &file_priv->event_list, link) {
382+
list_del(&e->link);
382383
e->destroy(e);
384+
}
383385

384386
spin_unlock_irqrestore(&dev->event_lock, flags);
385387
}

0 commit comments

Comments
 (0)