From 8a10f5c744e4cdddffeb145e2eabf82ff58760f5 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 5 Apr 2019 01:06:34 +0000 Subject: [PATCH] qla2x00t-32gbit: Calculate min_vecs correctly for kernel versions < v4.8 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8157 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t-32gbit/qla_isr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qla2x00t-32gbit/qla_isr.c b/qla2x00t-32gbit/qla_isr.c index 3130530c9..7099ede9d 100644 --- a/qla2x00t-32gbit/qla_isr.c +++ b/qla2x00t-32gbit/qla_isr.c @@ -3494,7 +3494,9 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) for (i = 0; i < ha->msix_count; i++) entries[i].entry = i; -#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) if (QLA_TGT_MODE_ENABLED() && (ql2xenablemsix != 0) && IS_ATIO_MSIX_CAPABLE(ha)) { min_vecs++; @@ -3511,6 +3513,8 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) } #endif + WARN_ON_ONCE(min_vecs > ha->msix_count); + #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0) && !defined(RHEL_MAJOR) ret = pci_enable_msix(ha->pdev, entries, ha->msix_count); if (ret) {