File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,14 @@ __evl_get_element_by_fundle(struct evl_index *map,
143
143
container_of(__e, __type, element); }) : NULL; \
144
144
})
145
145
146
+ /* Hide the element from sysfs operations. */
147
+ static inline void evl_hide_element (struct evl_element * e )
148
+ {
149
+ struct device * dev = e -> dev ;
150
+ if (dev )
151
+ dev_set_drvdata (dev , NULL );
152
+ }
153
+
146
154
static inline bool evl_element_is_public (struct evl_element * e )
147
155
{
148
156
return !!(e -> clone_flags & EVL_CLONE_PUBLIC );
Original file line number Diff line number Diff line change @@ -277,6 +277,14 @@ static void uninit_thread(struct evl_thread *thread)
277
277
unsigned long flags ;
278
278
struct evl_rq * rq ;
279
279
280
+ /*
281
+ * Threads are special elements in that they may exit
282
+ * independently from the existence of their respective
283
+ * backing cdev. Make sure to hide exiting threads from sysfs
284
+ * handlers before we dismantle things.
285
+ */
286
+ evl_hide_element (& thread -> element );
287
+
280
288
evl_destroy_timer (& thread -> rtimer );
281
289
evl_destroy_timer (& thread -> ptimer );
282
290
You can’t perform that action at this time.
0 commit comments