Commit 3a5da467 authored by Thomas Richter's avatar Thomas Richter Committed by Heiko Carstens

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: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
Acked-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 225d09d6
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment