Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Sep 2022 21:09:33 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d4accf60d9bd - main - arm64: don't loop forever if first option in kern.cfg.order not available
Message-ID:  <202209232109.28NL9XTw097508@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=d4accf60d9bd257965620530d6893eb6889e0dd0

commit d4accf60d9bd257965620530d6893eb6889e0dd0
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-09-23 21:02:53 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-09-23 21:07:23 +0000

    arm64: don't loop forever if first option in kern.cfg.order not available
    
    strchr returns a pointer to the ',', so if the first option in the list
    isn't available, we need to step over the , to look at the next
    option. So if kern.cfg.order="acpi,fdt" and we have no acpi, we'd loop
    forever with order=',fdt'.
    
    Sponsored by:           Netflix
    Reviewed by:            andrew, jhb
    Differential Revision:  https://reviews.freebsd.org/D36682
---
 sys/arm64/arm64/machdep.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c
index 51932905ec82..46773c1911b4 100644
--- a/sys/arm64/arm64/machdep.c
+++ b/sys/arm64/arm64/machdep.c
@@ -646,6 +646,8 @@ bus_probe(void)
 				break;
 			}
 			order = strchr(order, ',');
+			if (order != NULL)
+				order++;	/* Skip comma */
 		}
 		freeenv(env);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202209232109.28NL9XTw097508>