Skip to content

Commit 0ff86d8

Browse files
committed
Merge tag 'sh-for-v6.13-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux
Pull sh updates from John Paul Adrian Glaubitz: "Two small fixes. The first one by Huacai Chen addresses a runtime warning when CONFIG_CPUMASK_OFFSTACK and CONFIG_DEBUG_PER_CPU_MAPS are selected which occurs because the cpuinfo code on sh incorrectly uses NR_CPUS when iterating CPUs instead of the runtime limit nr_cpu_ids. A second fix by Dan Carpenter fixes a use-after-free bug in register_intc_controller() which occurred as a result of improper error handling in the interrupt controller driver code when registering an interrupt controller during plat_irq_setup() on sh" * tag 'sh-for-v6.13-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux: sh: intc: Fix use-after-free bug in register_intc_controller() sh: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK
2 parents 50ee4a6 + 63e72e5 commit 0ff86d8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/sh/kernel/cpu/proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
132132

133133
static void *c_start(struct seq_file *m, loff_t *pos)
134134
{
135-
return *pos < NR_CPUS ? cpu_data + *pos : NULL;
135+
return *pos < nr_cpu_ids ? cpu_data + *pos : NULL;
136136
}
137137
static void *c_next(struct seq_file *m, void *v, loff_t *pos)
138138
{

drivers/sh/intc/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ int __init register_intc_controller(struct intc_desc *desc)
209209
goto err0;
210210

211211
INIT_LIST_HEAD(&d->list);
212-
list_add_tail(&d->list, &intc_list);
213212

214213
raw_spin_lock_init(&d->lock);
215214
INIT_RADIX_TREE(&d->tree, GFP_ATOMIC);
@@ -369,6 +368,7 @@ int __init register_intc_controller(struct intc_desc *desc)
369368

370369
d->skip_suspend = desc->skip_syscore_suspend;
371370

371+
list_add_tail(&d->list, &intc_list);
372372
nr_intc_controllers++;
373373

374374
return 0;

0 commit comments

Comments
 (0)