]> www.infradead.org Git - users/hch/misc.git/commitdiff
hrtimer: Add missing ACCESS_PRIVATE() for hrtimer::function
authorNam Cao <namcao@linutronix.de>
Tue, 8 Apr 2025 10:38:54 +0000 (12:38 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 9 Apr 2025 19:00:42 +0000 (21:00 +0200)
The "function" field of struct hrtimer has been changed to private, but
two instances have not been converted to use ACCESS_PRIVATE().

Convert them to use ACCESS_PRIVATE().

Fixes: 04257da0c99c ("hrtimers: Make callback function pointer private")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250408103854.1851093-1-namcao@linutronix.de
Closes: https://lore.kernel.org/oe-kbuild-all/202504071931.vOVl13tt-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202504072155.5UAZjYGU-lkp@intel.com/
include/linux/hrtimer.h
kernel/time/hrtimer.c

index 1adcba3ddd7660e9ae4c0419553bab1f7917af43..1ef867bb8c44b06812d8552441d4092922bfe170 100644 (file)
@@ -345,7 +345,7 @@ static inline void hrtimer_update_function(struct hrtimer *timer,
        if (WARN_ON_ONCE(!function))
                return;
 #endif
-       timer->function = function;
+       ACCESS_PRIVATE(timer, function) = function;
 }
 
 /* Forward a hrtimer so it expires after now: */
index 517ee2590a29e57356ef96cae80ef6c34aa6eba1..30899a8cc52c0a9203ce0216fe47f5f19a7bf6ec 100644 (file)
@@ -366,7 +366,7 @@ static const struct debug_obj_descr hrtimer_debug_descr;
 
 static void *hrtimer_debug_hint(void *addr)
 {
-       return ((struct hrtimer *) addr)->function;
+       return ACCESS_PRIVATE((struct hrtimer *)addr, function);
 }
 
 /*