mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
bhyve: ahci: Fix regression with no ports
An AHCI controller may be specified with no connected ports. Avoid
dumping core in this case for compatibility with existing VM configs.
Reviewed by: khng, jhb
Fixes: 621b509048 Refactor configuration management in bhyve.
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D33969
This commit is contained in:
parent
eb815a7419
commit
b252fb2430
1 changed files with 1 additions and 1 deletions
|
|
@ -2440,7 +2440,7 @@ pci_ahci_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl)
|
|||
slots = 32;
|
||||
|
||||
ports_nvl = find_relative_config_node(nvl, "port");
|
||||
for (p = 0; p < MAX_PORTS; p++) {
|
||||
for (p = 0; ports_nvl != NULL && p < MAX_PORTS; p++) {
|
||||
struct ata_params *ata_ident = &sc->port[p].ata_ident;
|
||||
char ident[AHCI_PORT_IDENT];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue