]> www.infradead.org Git - users/willy/linux.git/commit
drivers/perf: riscv: Return error for default case
authorAtish Patra <atishp@rivosinc.com>
Fri, 13 Dec 2024 00:09:33 +0000 (16:09 -0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 9 Jan 2025 17:37:09 +0000 (09:37 -0800)
commit2c206cdede567f53035c622e846678a996f39d69
tree66ef78ac00ef400b423c2628fe8ab371f887df3d
parentfc58db9aeb15e89b69ff5e9abc69ecf9e5f888ed
drivers/perf: riscv: Return error for default case

If the upper two bits has an invalid valid (0x1), the event mapping
is not reliable as it returns an uninitialized variable.

Return appropriate value for the default case.

Fixes: f0c9363db2dd ("perf/riscv-sbi: Add platform specific firmware event handling")
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20241212-pmu_event_fixes_v2-v2-2-813e8a4f5962@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
drivers/perf/riscv_pmu_sbi.c