Skip to content

Commit 1af5c1d

Browse files
committed
Merge tag 'timers-urgent-2025-11-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Ingo Molnar: - Fix a race in timer->function clearing in timer_shutdown_sync() - Fix a timekeeper sysfs-setup resource leak in error paths - Fix the NOHZ report_idle_softirq() syslog rate-limiting logic to have no side effects on the return value * tag 'timers-urgent-2025-11-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: timers: Fix NULL function pointer race in timer_shutdown_sync() timekeeping: Fix resource leak in tk_aux_sysfs_init() error paths tick/sched: Fix bogus condition in report_idle_softirq()
2 parents e624f73 + 20739af commit 1af5c1d

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

kernel/time/tick-sched.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,16 +1152,15 @@ static bool report_idle_softirq(void)
11521152
return false;
11531153
}
11541154

1155-
if (ratelimit >= 10)
1156-
return false;
1157-
11581155
/* On RT, softirq handling may be waiting on some lock */
11591156
if (local_bh_blocked())
11601157
return false;
11611158

1162-
pr_warn("NOHZ tick-stop error: local softirq work is pending, handler #%02x!!!\n",
1163-
pending);
1164-
ratelimit++;
1159+
if (ratelimit < 10) {
1160+
pr_warn("NOHZ tick-stop error: local softirq work is pending, handler #%02x!!!\n",
1161+
pending);
1162+
ratelimit++;
1163+
}
11651164

11661165
return true;
11671166
}

kernel/time/timekeeping.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3060,29 +3060,32 @@ static const struct attribute_group aux_clock_enable_attr_group = {
30603060
static int __init tk_aux_sysfs_init(void)
30613061
{
30623062
struct kobject *auxo, *tko = kobject_create_and_add("time", kernel_kobj);
3063+
int ret = -ENOMEM;
30633064

30643065
if (!tko)
3065-
return -ENOMEM;
3066+
return ret;
30663067

30673068
auxo = kobject_create_and_add("aux_clocks", tko);
3068-
if (!auxo) {
3069-
kobject_put(tko);
3070-
return -ENOMEM;
3071-
}
3069+
if (!auxo)
3070+
goto err_clean;
30723071

30733072
for (int i = 0; i < MAX_AUX_CLOCKS; i++) {
30743073
char id[2] = { [0] = '0' + i, };
30753074
struct kobject *clk = kobject_create_and_add(id, auxo);
30763075

30773076
if (!clk)
3078-
return -ENOMEM;
3079-
3080-
int ret = sysfs_create_group(clk, &aux_clock_enable_attr_group);
3077+
goto err_clean;
30813078

3079+
ret = sysfs_create_group(clk, &aux_clock_enable_attr_group);
30823080
if (ret)
3083-
return ret;
3081+
goto err_clean;
30843082
}
30853083
return 0;
3084+
3085+
err_clean:
3086+
kobject_put(auxo);
3087+
kobject_put(tko);
3088+
return ret;
30863089
}
30873090
late_initcall(tk_aux_sysfs_init);
30883091

kernel/time/timer.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,10 +1458,11 @@ static int __try_to_del_timer_sync(struct timer_list *timer, bool shutdown)
14581458

14591459
base = lock_timer_base(timer, &flags);
14601460

1461-
if (base->running_timer != timer)
1461+
if (base->running_timer != timer) {
14621462
ret = detach_if_pending(timer, base, true);
1463-
if (shutdown)
1464-
timer->function = NULL;
1463+
if (shutdown)
1464+
timer->function = NULL;
1465+
}
14651466

14661467
raw_spin_unlock_irqrestore(&base->lock, flags);
14671468

0 commit comments

Comments
 (0)