Skip to content

Commit

Permalink
Merge tag 'sh-for-v6.13-tag1' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/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
  • Loading branch information
torvalds committed Nov 30, 2024
2 parents 50ee4a6 + 63e72e5 commit 0ff86d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/sh/kernel/cpu/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)

static void *c_start(struct seq_file *m, loff_t *pos)
{
return *pos < NR_CPUS ? cpu_data + *pos : NULL;
return *pos < nr_cpu_ids ? cpu_data + *pos : NULL;
}
static void *c_next(struct seq_file *m, void *v, loff_t *pos)
{
Expand Down
2 changes: 1 addition & 1 deletion drivers/sh/intc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ int __init register_intc_controller(struct intc_desc *desc)
goto err0;

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

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

d->skip_suspend = desc->skip_syscore_suspend;

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

return 0;
Expand Down

0 comments on commit 0ff86d8

Please sign in to comment.