aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Bowling <kbowling@FreeBSD.org>2026-08-10 04:53:08 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2026-08-10 08:44:53 +0000
commitae122c5443882ae4d3d19aacfcfd16a2c8d7b688 (patch)
treee0bf5b4c7061d4cef1b7881171bc21cc60b7ebe6
parent8eb4403e9d4a35f33a0ce41067ccb1924c6960dd (diff)
ixl: Initialize VF sysctl contexts before use
The VF array is zeroed at allocation, but its sysctl contexts were only populated after each VF was successfully added. If VF setup failed, IOV teardown still passed every requested VF context to sysctl_ctx_free(). An untouched context is not an initialized empty TAILQ and caused a page fault during teardown. Initialize every VF context with the array so both successful setup and partial-failure cleanup have a valid lifetime. MFC after: 2 weeks
-rw-r--r--sys/dev/ixl/ixl_pf_iov.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/ixl/ixl_pf_iov.c b/sys/dev/ixl/ixl_pf_iov.c
index de8e2c27b9eb..e749797fa700 100644
--- a/sys/dev/ixl/ixl_pf_iov.c
+++ b/sys/dev/ixl/ixl_pf_iov.c
@@ -1654,7 +1654,7 @@ ixl_if_iov_init(if_ctx_t ctx, uint16_t num_vfs, const nvlist_t *params)
struct i40e_hw *hw;
struct ixl_vsi *pf_vsi;
enum i40e_status_code ret;
- int error;
+ int error, i;
hw = &pf->hw;
pf_vsi = &pf->vsi;
@@ -1665,6 +1665,8 @@ ixl_if_iov_init(if_ctx_t ctx, uint16_t num_vfs, const nvlist_t *params)
error = ENOMEM;
goto fail;
}
+ for (i = 0; i < num_vfs; i++)
+ sysctl_ctx_init(&pf->vfs[i].vsi.sysctl_ctx);
/*
* Add the VEB and ...