Date: Mon, 5 Jul 2021 13:53:20 GMT From: Emmanuel Vadot <manu@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: b464c459eaf4 - main - loader: Fix dtb loading Message-ID: <202107051353.165DrKCQ004895@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=b464c459eaf4e63a3abaaa1ecf51c9d6e9f7521e commit b464c459eaf4e63a3abaaa1ecf51c9d6e9f7521e Author: Emmanuel Vadot <manu@FreeBSD.org> AuthorDate: 2021-07-05 13:50:39 +0000 Commit: Emmanuel Vadot <manu@FreeBSD.org> CommitDate: 2021-07-05 13:53:08 +0000 loader: Fix dtb loading When calling file_findfile with only a type it returns the first file matching the type. But in fdt_apply_overlays we then iterate on the next files and try loading them as dtb overlays. Fix this by checking the type one more time. Sponsored by: Diablotin Systems Reported by: Mark Millard <marklmi@yahoo.com> --- stand/fdt/fdt_loader_cmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/fdt/fdt_loader_cmd.c b/stand/fdt/fdt_loader_cmd.c index 7580eceedb05..c14b99768d70 100644 --- a/stand/fdt/fdt_loader_cmd.c +++ b/stand/fdt/fdt_loader_cmd.c @@ -466,6 +466,8 @@ fdt_apply_overlays() current_fdtp_size = fdtp_size; overlays_applied = 0; for (fp = file_findfile(NULL, "dtbo"); fp != NULL; fp = fp->f_next) { + if (strcmp(fp->f_type, "dtbo") != 0) + continue; COPYOUT(fp->f_addr, overlay, fp->f_size); /* Check compatible first to avoid unnecessary allocation */ rv = fdt_check_overlay_compatible(current_fdtp, overlay);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107051353.165DrKCQ004895>