File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
drivers/gpu/drm/scheduler Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -71,13 +71,19 @@ int drm_sched_entity_init(struct drm_sched_entity *entity,
71
71
entity -> guilty = guilty ;
72
72
entity -> num_sched_list = num_sched_list ;
73
73
entity -> priority = priority ;
74
+ /*
75
+ * It's perfectly valid to initialize an entity without having a valid
76
+ * scheduler attached. It's just not valid to use the scheduler before it
77
+ * is initialized itself.
78
+ */
74
79
entity -> sched_list = num_sched_list > 1 ? sched_list : NULL ;
75
80
RCU_INIT_POINTER (entity -> last_scheduled , NULL );
76
81
RB_CLEAR_NODE (& entity -> rb_tree_node );
77
82
78
- if (!sched_list [0 ]-> sched_rq ) {
79
- /* Warn drivers not to do this and to fix their DRM
80
- * calling order.
83
+ if (num_sched_list && !sched_list [0 ]-> sched_rq ) {
84
+ /* Since every entry covered by num_sched_list
85
+ * should be non-NULL and therefore we warn drivers
86
+ * not to do this and to fix their DRM calling order.
81
87
*/
82
88
pr_warn ("%s: called with uninitialized scheduler\n" , __func__ );
83
89
} else if (num_sched_list ) {
You can’t perform that action at this time.
0 commit comments