qla2x00t-32gbit: Add a runtime array bounds check

Complain if the msix_entries[] array is accessed outside its bounds.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8164 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-04-06 23:17:27 +00:00
parent 556a7f6cf2
commit 8ed7f4bbc1

View File

@@ -3614,6 +3614,7 @@ msix_failed:
/* Enable MSI-X vectors for the base queue */
for (i = 0; i < QLA_BASE_VECTORS; i++) {
WARN(i >= ha->msix_count, "%d > %d\n", i, ha->msix_count);
qentry = &ha->msix_entries[i];
qentry->handle = rsp;
rsp->msix = qentry;
@@ -3639,6 +3640,8 @@ msix_failed:
*/
if (QLA_TGT_MODE_ENABLED() && (ql2xenablemsix != 0) &&
IS_ATIO_MSIX_CAPABLE(ha)) {
WARN(QLA_ATIO_VECTOR >= ha->msix_count, "%d > %d\n",
QLA_ATIO_VECTOR, ha->msix_count);
qentry = &ha->msix_entries[QLA_ATIO_VECTOR];
rsp->msix = qentry;
qentry->handle = rsp;