From nobody Fri Jan 21 13:00:13 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DE9661959EB6; Fri, 21 Jan 2022 13:00:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JgKH15m7lz4hHm; Fri, 21 Jan 2022 13:00:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642770013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e+sRR6JPrNjFR6Y17bXR76f/e6RV6gnQG/oXZcPYEGg=; b=byLrZRpmyZfPwzYEF31dIKx/VOYm9nmLs2xfp/ZgkMHH+HnkN/V7w/yM8Wj0P8nShxpjBY 3ixMy8lxpoKHHAI6VeKBi8lktgLYTLhcPUqYUkc9gcn3NthbIjYyyHg8Y9RHs3V+HNg6YK UVNZiuGl/9tDyvsgwgNNxvVRv2Gw0jBOaxvmtO5xt0+aitewjlQjLdJfJ7YKroN888Js4K 55bQXTAPgyv2Lc7kr7TxsQEVc38uK8UFS7HjFWZ5yB+9uZqYBzxPWjZs9dPvrLu0jT0jXX 7acjKKlJ8/xW3y/S2dpqTdrc4W6cP3sGQz9T7Wg7mdE0tkrwlUjhGAKR9t2NfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A57261BB69; Fri, 21 Jan 2022 13:00:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20LD0DQ3046789; Fri, 21 Jan 2022 13:00:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20LD0Dau046782; Fri, 21 Jan 2022 13:00:13 GMT (envelope-from git) Date: Fri, 21 Jan 2022 13:00:13 GMT Message-Id: <202201211300.20LD0Dau046782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Moeller Subject: git: b252fb24301c - main - bhyve: ahci: Fix regression with no ports List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b252fb24301c1f7e7d83eab631e7d9fa947e227d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642770013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e+sRR6JPrNjFR6Y17bXR76f/e6RV6gnQG/oXZcPYEGg=; b=pRAV0QmTvJZJ2mctpeBP3/xYmWVxnooM97O90AD1WOiJ6vUOli7euhfD/QBal1j6bY2bJU l33lCLl5vW73GxB8r+74aGkMRGyL1iuxbRNx5el/0i7MMgkNsyDvjulkEjMMX7jVzhrX3m p5z/0CLINY+DEFa0q3x2DQtHb+Db9tFboyATkyXwWHMID4LGhRASyXl+eXx0OzCiqZq1a8 ByhYSYElYfdrvLHXB36Zgx/FaCPwClI8RLH+N27ass7pbm2eH6MHErh/oCD47+7ofFhKKq UZj9unweEyHf/GbjPFLsP9X7GrnN8APO1Fn3vDIbnhnF8893nh9ujoUdie7x1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642770013; a=rsa-sha256; cv=none; b=U9Cd3327E7KS2x6/Eu2o/VeRWLaeANv0MDAe8y7kINCFI1nYSvVdRuSRZLQ0HjcR4mPcCG rE7LpZeUXiXprXOQcopdrefRvzhgiEBDx/l5wVHs6IcuxBwrnuF5CXmSWBSY41I+bVb+Ev c/uWJ584uUCEhlnGl0swiU9cc2sj9xwu8Cf0fb5ET2tBgXjS1b2y/C90NAFRpo/gXvdFe3 Tyf6X9Eld92L0xyV+8xMkbASa3vP6BNgIz/2uGQ+Oec/HuJSE9x3v7EPuM/AUFuTWnZsV+ fjUIhThdBJu6063sEDWTTFDrx9wcQnB5Xg6rZZOCF17w8QH0hgEf7c3H0dHOAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=b252fb24301c1f7e7d83eab631e7d9fa947e227d commit b252fb24301c1f7e7d83eab631e7d9fa947e227d Author: Ryan Moeller AuthorDate: 2022-01-21 12:59:25 +0000 Commit: Ryan Moeller CommitDate: 2022-01-21 12:59:25 +0000 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: 621b5090487de Refactor configuration management in bhyve. MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D33969 --- usr.sbin/bhyve/pci_ahci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_ahci.c b/usr.sbin/bhyve/pci_ahci.c index 316fbcf0f18d..d07b1f085e3d 100644 --- a/usr.sbin/bhyve/pci_ahci.c +++ b/usr.sbin/bhyve/pci_ahci.c @@ -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];