mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 13:52:50 +01:00
The DRM scheduler KUnit tests pass NULL for the dev field in
drm_sched_init_args, which NULL-pointer dereferences in the drm_sched_job
trace event via dev_name() on sched->dev.
Give the mock scheduler a device with kunit_device_register(), which is
also cleaned up at test exit. A per-function counter keeps the device
names unique, since some tests create several mock schedulers.
Fixes: 5a99350794 ("drm/sched: Add scheduler unit testing infrastructure and some basic tests")
Cc: [email protected]
Signed-off-by: Shixiong Ou <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
[phasta: removed static variable init to 0 again]
Signed-off-by: Philipp Stanner <[email protected]>
Link: https://patch.msgid.link/[email protected]