aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitchell Horne <mhorne@FreeBSD.org>2020-12-15 14:54:36 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2020-12-15 14:54:36 +0000
commitd577260e2365e1c04e2d4a7cdbbddaf96605c731 (patch)
treece0c693b56a7da3d442da912f191749fb73afd94
parent08d13750ebdae45bcdb73d52665b823e9ba93db1 (diff)
downloadsrc-d577260e2365e1c04e2d4a7cdbbddaf96605c731.tar.gz
src-d577260e2365e1c04e2d4a7cdbbddaf96605c731.zip
MFC r368281:
em: fix a null de-reference in em_free_pci_resources
Notes
Notes: svn path=/stable/12/; revision=368660
-rw-r--r--sys/dev/e1000/if_em.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index 42faacfc3eea..8fc40586ad76 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -2217,8 +2217,10 @@ em_free_pci_resources(if_ctx_t ctx)
if (adapter->intr_type == IFLIB_INTR_MSIX)
iflib_irq_free(ctx, &adapter->irq);
- for (int i = 0; i < adapter->rx_num_queues; i++, que++) {
- iflib_irq_free(ctx, &que->que_irq);
+ if (que != NULL) {
+ for (int i = 0; i < adapter->rx_num_queues; i++, que++) {
+ iflib_irq_free(ctx, &que->que_irq);
+ }
}
if (adapter->memory != NULL) {