diff options
author | Thomas Richter <[email protected]> | 2024-01-18 13:24:45 +0100 |
---|---|---|
committer | Heiko Carstens <[email protected]> | 2024-02-09 13:58:13 +0100 |
commit | 3a5da4670dfad43e8e0b0c7135409c1f70230797 (patch) | |
tree | 711bf3cd101ba2841bc0965f7073c7296cb063bc | |
parent | 225d09d6e5f3870560665a1829d2db79330b4c58 (diff) |
s390/pai_crypto: emit error on too many counters
When the device driver is initialized, it checks the number of
possible counters. Should this number be too high, emit an error
and return.
Reported-by: Sumanth Korikkar <[email protected]>
Signed-off-by: Thomas Richter <[email protected]>
Acked-by: Sumanth Korikkar <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
-rw-r--r-- | arch/s390/kernel/perf_pai_crypto.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/s390/kernel/perf_pai_crypto.c b/arch/s390/kernel/perf_pai_crypto.c index 522a5ea0a9f4..69639ff1c5e0 100644 --- a/arch/s390/kernel/perf_pai_crypto.c +++ b/arch/s390/kernel/perf_pai_crypto.c @@ -742,8 +742,10 @@ static int __init paicrypt_init(void) paicrypt_cnt = ib.num_cc; if (paicrypt_cnt == 0) return 0; - if (paicrypt_cnt >= PAI_CRYPTO_MAXCTR) - paicrypt_cnt = PAI_CRYPTO_MAXCTR - 1; + if (paicrypt_cnt >= PAI_CRYPTO_MAXCTR) { + pr_err("Too many PMU pai_crypto counters %d\n", paicrypt_cnt); + return -1; + } rc = attr_event_init(); /* Export known PAI crypto events */ if (rc) { |