Merge tag 'riscv-for-linus-6.12-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fix from Palmer Dabbelt: - A fix for the CPU perf driver that avoids leaking CPU ID references on systems without snapshot support. * tag 'riscv-for-linus-6.12-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: drivers: perf: Fix wrong put_cpu() placement
This commit is contained in:
@@ -1393,8 +1393,9 @@ static int pmu_sbi_device_probe(struct platform_device *pdev)
|
||||
goto out_unregister;
|
||||
|
||||
cpu = get_cpu();
|
||||
|
||||
ret = pmu_sbi_snapshot_setup(pmu, cpu);
|
||||
put_cpu();
|
||||
|
||||
if (ret) {
|
||||
/* Snapshot is an optional feature. Continue if not available */
|
||||
pmu_sbi_snapshot_free(pmu);
|
||||
@@ -1408,7 +1409,6 @@ static int pmu_sbi_device_probe(struct platform_device *pdev)
|
||||
*/
|
||||
static_branch_enable(&sbi_pmu_snapshot_available);
|
||||
}
|
||||
put_cpu();
|
||||
}
|
||||
|
||||
register_sysctl("kernel", sbi_pmu_sysctl_table);
|
||||
|
||||
Reference in New Issue
Block a user