History

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Catalin Marinas: "arm64 and arm/perf fixes: - arm64 fix: debug exception unmasking on the CPU resume path - ARM PMU fixes: memory leak on error path and NULL pointer dereference" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: kernel: Fix unmasked debug exceptions when restoring mdscr_el1 drivers/perf: arm_pmu: Fix NULL pointer dereference during probe drivers/perf: arm_pmu: Fix leak in error path

Linus Torvalds committed 10 years ago

Commit 2bece1a2 parents 593ee4e 744c6c32 files · +11 −1Browse files

Unified · Split

2 files
  1. arch/arm64/mm/proc.S +9 −0
  2. drivers/perf/arm_pmu.c +2 −1
arch/arm64/mm/proc.S+9−0
@@ -100,7 +100,16 @@ ENTRY(cpu_do_resume) · 99 unmodified lines
100100
101101 msr tcr_el1, x8
102102 msr vbar_el1, x9
103+
104+ /*
105+ * __cpu_setup() cleared MDSCR_EL1.MDE and friends, before unmasking
106+ * debug exceptions. By restoring MDSCR_EL1 here, we may take a debug
107+ * exception. Mask them until local_dbg_restore() in cpu_suspend()
108+ * resets them.
109+ */
110+ disable_dbg
103111 msr mdscr_el1, x10
112+
104113 msr sctlr_el1, x12
105114 /*
106115 * Restore oslsr_el1 by writing oslar_el1
drivers/perf/arm_pmu.c+2−1
@@ -925,6 +925,7 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu) · 924 unmodified lines
925925 if (i > 0 && spi != using_spi) {
926926 pr_err("PPI/SPI IRQ type mismatch for %s!\n",
927927 dn->name);
928+ of_node_put(dn);
928929 kfree(irqs);
929930 return -EINVAL;
930931 }
@@ -969,7 +970,7 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu) · 38 unmodified lines
969970 if (cpumask_weight(&pmu->supported_cpus) == 0) {
970971 int irq = platform_get_irq(pdev, 0);
971972
972− if (irq_is_percpu(irq)) {
973+ if (irq >= 0 && irq_is_percpu(irq)) {
973974 /* If using PPIs, check the affinity of the partition */
974975 int ret;
975976