Skip to content

Commit 2424e14

Browse files
covanamKAGA-KOKO
authored andcommitted
hrtimer: Add missing ACCESS_PRIVATE() for hrtimer::function
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: 04257da ("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/
1 parent 0af2f6b commit 2424e14

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/linux/hrtimer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ static inline void hrtimer_update_function(struct hrtimer *timer,
345345
if (WARN_ON_ONCE(!function))
346346
return;
347347
#endif
348-
timer->function = function;
348+
ACCESS_PRIVATE(timer, function) = function;
349349
}
350350

351351
/* Forward a hrtimer so it expires after now: */

kernel/time/hrtimer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ static const struct debug_obj_descr hrtimer_debug_descr;
366366

367367
static void *hrtimer_debug_hint(void *addr)
368368
{
369-
return ((struct hrtimer *) addr)->function;
369+
return ACCESS_PRIVATE((struct hrtimer *)addr, function);
370370
}
371371

372372
/*

0 commit comments

Comments
 (0)