File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -758,6 +758,17 @@ static bool assign_lock_key(struct lockdep_map *lock)
758
758
{
759
759
unsigned long can_addr , addr = (unsigned long )lock ;
760
760
761
+ #ifdef __KERNEL__
762
+ /*
763
+ * lockdep_free_key_range() assumes that struct lock_class_key
764
+ * objects do not overlap. Since we use the address of lock
765
+ * objects as class key for static objects, check whether the
766
+ * size of lock_class_key objects does not exceed the size of
767
+ * the smallest lock object.
768
+ */
769
+ BUILD_BUG_ON (sizeof (struct lock_class_key ) > sizeof (raw_spinlock_t ));
770
+ #endif
771
+
761
772
if (__is_kernel_percpu_address (addr , & can_addr ))
762
773
lock -> key = (void * )can_addr ;
763
774
else if (__is_module_percpu_address (addr , & can_addr ))
You can’t perform that action at this time.
0 commit comments