hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/crypto/ccp/ccp-dev-v3.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * AMD Cryptographic Coprocessor (CCP) driver
34 *
....@@ -5,15 +6,10 @@
56 *
67 * Author: Tom Lendacky <thomas.lendacky@amd.com>
78 * Author: Gary R Hook <gary.hook@amd.com>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 as
11
- * published by the Free Software Foundation.
129 */
1310
1411 #include <linux/module.h>
1512 #include <linux/kernel.h>
16
-#include <linux/pci.h>
1713 #include <linux/kthread.h>
1814 #include <linux/interrupt.h>
1915 #include <linux/ccp.h>
....@@ -382,7 +378,7 @@
382378 /* Find available queues */
383379 ccp->qim = 0;
384380 qmr = ioread32(ccp->io_regs + Q_MASK_REG);
385
- for (i = 0; i < MAX_HW_QUEUES; i++) {
381
+ for (i = 0; (i < MAX_HW_QUEUES) && (ccp->cmd_q_count < ccp->max_q_count); i++) {
386382 if (!(qmr & (1 << i)))
387383 continue;
388384