Boris Brezillon d4c16733e7 drm/sched: Fix drm_sched_fence_free() so it can be passed an uninitialized fence
drm_sched_job_cleanup() will pass an uninitialized fence to
drm_sched_fence_free(), which will cause to_drm_sched_fence() to return
a NULL fence object, causing a NULL pointer deref when this NULL object
is passed to kmem_cache_free().

Let's create a new drm_sched_fence_free() function that takes a
drm_sched_fence pointer and suffix the old function with _rcu. While at
it, complain if drm_sched_fence_free() is passed an initialized fence
or if drm_sched_fence_free_rcu() is passed an uninitialized fence.

Fixes: dbe48d030b28 ("drm/sched: Split drm_sched_job_init")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210903120554.444101-1-boris.brezillon@collabora.com
2021-09-07 09:58:26 +02:00
..
2021-09-03 11:03:59 +02:00
2021-07-29 09:12:01 +02:00
2021-08-10 20:14:01 +02:00
2021-06-11 12:30:39 -07:00
2021-07-21 11:58:28 +10:00
2021-08-10 20:14:01 +02:00
2021-08-12 16:50:04 +02:00
2021-08-02 16:41:20 +02:00
2021-08-13 17:50:48 +02:00
2021-08-10 20:14:01 +02:00
2020-09-17 13:39:44 +02:00
2021-08-29 21:31:51 +02:00
2020-07-16 18:16:31 -04:00
2021-03-16 13:12:46 +01:00
2019-12-18 16:09:12 -05:00