Mark the access to reservation_object.fence as being protected to silence sparse.
Unified · Split
| @@ -216,8 +216,12 @@ reservation_object_unlock(struct reservation_object *obj) · 215 unmodified lines | ||
| 216 | 216 | { |
| 217 | 217 | #ifdef CONFIG_DEBUG_MUTEXES |
| 218 | 218 | /* Test shared fence slot reservation */ |
| 219 | − if (obj->fence) | |
| 220 | − obj->fence->shared_max = obj->fence->shared_count; | |
| 219 | + if (rcu_access_pointer(obj->fence)) { | |
| 220 | + struct reservation_object_list *fence = | |
| 221 | + reservation_object_get_list(obj); | |
| 222 | + | |
| 223 | + fence->shared_max = fence->shared_count; | |
| 224 | + } | |
| 221 | 225 | #endif |
| 222 | 226 | ww_mutex_unlock(&obj->lock); |
| 223 | 227 | } |