Commit 39a9ed0
timekeeping: Fix aux clocks sysfs initialization loop bound
The loop in tk_aux_sysfs_init() uses `i <= MAX_AUX_CLOCKS` as the
termination condition, which results in 9 iterations (i=0 to 8) when
MAX_AUX_CLOCKS is defined as 8. However, the kernel is designed to support
only up to 8 auxiliary clocks.
This off-by-one error causes the creation of a 9th sysfs entry that exceeds
the intended auxiliary clock range.
Fix the loop bound to use `i < MAX_AUX_CLOCKS` to ensure exactly 8
auxiliary clock entries are created, matching the design specification.
Fixes: 7b95663 ("timekeeping: Provide interface to control auxiliary clocks")
Signed-off-by: Haofeng Li <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://patch.msgid.link/[email protected]1 parent 211ddde commit 39a9ed0
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3070 | 3070 | | |
3071 | 3071 | | |
3072 | 3072 | | |
3073 | | - | |
| 3073 | + | |
3074 | 3074 | | |
3075 | 3075 | | |
3076 | 3076 | | |
| |||
0 commit comments