| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * AMD Cryptographic Coprocessor (CCP) driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Author: Tom Lendacky <thomas.lendacky@amd.com> |
|---|
| 7 | 8 | * 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. |
|---|
| 12 | 9 | */ |
|---|
| 13 | 10 | |
|---|
| 14 | 11 | #include <linux/module.h> |
|---|
| 15 | 12 | #include <linux/kernel.h> |
|---|
| 16 | | -#include <linux/pci.h> |
|---|
| 17 | 13 | #include <linux/kthread.h> |
|---|
| 18 | 14 | #include <linux/interrupt.h> |
|---|
| 19 | 15 | #include <linux/ccp.h> |
|---|
| .. | .. |
|---|
| 382 | 378 | /* Find available queues */ |
|---|
| 383 | 379 | ccp->qim = 0; |
|---|
| 384 | 380 | 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++) { |
|---|
| 386 | 382 | if (!(qmr & (1 << i))) |
|---|
| 387 | 383 | continue; |
|---|
| 388 | 384 | |
|---|