From nobody Fri Jan 14 13:47:09 2022 X-Original-To: dev-commits-src-branches@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 8D68F19443B9; Fri, 14 Jan 2022 13:47:09 +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 4Jb2fP27TZz53Vl; Fri, 14 Jan 2022 13:47:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642168029; 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=EC6Wi3oSbe1mtIeuuRgEaG+nq4rAuEl5ImIImdAXU88=; b=E2SrDXhBv2gW/DCDjio2REuipTeTRQjMrrHUBoZ+dtjRAl6HKJtvhIMsafdc7jWPtfbHCV 7UsRE8hB2OAepmJZQVDCBxdv55OARw4j1JjycU1Zdb4sSEIN+q+REgTuI7OH3oEsNzdjUx V35BG7b0XyUHyFKO5870IfgEVNPunEbkVo4U7iNyCIHZVGrdY/46snsp2rheKUc+tuf+tw KZqlNqKiCroqSB4WbKEf4+AyiaZWxW19p2HU2jVv6oh7SGg7Y4haIxGyyE/lAaUAzzzprW o/NUelZKGoWFNU2BEazovIikPS1qXqyvJEYx4A8pqfDIjTQ69gI/kz5v8G+zDw== 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 1F326147F7; Fri, 14 Jan 2022 13:47:09 +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 20EDl9Ql037411; Fri, 14 Jan 2022 13:47:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20EDl9xS037410; Fri, 14 Jan 2022 13:47:09 GMT (envelope-from git) Date: Fri, 14 Jan 2022 13:47:09 GMT Message-Id: <202201141347.20EDl9xS037410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: b47fc941b0ab - stable/13 - loader: Fix dtb loading List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b47fc941b0abcb6462c7a0a0d15c7fee5873eb1e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642168029; 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=EC6Wi3oSbe1mtIeuuRgEaG+nq4rAuEl5ImIImdAXU88=; b=HRDdLGJrXts0Ng/cAtReiEk6MqnIG2EUoVeY1vni7ud4DPO2lFvwteOKFAZgWsF8rFRevD eG0zWmlGT5OG03leVXIimbSfZyS2M6D2iend6XnFNRc5tPVnO9UKIqOSxRSLJthlnveDfF r6Uqb5dwdpcbF/SyKM5vg3liDzLE7LS+nW3C0rELEMFH1m5jV8kop3eV6eKDCTMK5uVgwb hWnvxL/RWkr3YnW4CavJv3vF8gzb4WOpxshLo5CnHyuq4Gap6oWrT/h72MUDEpmilRPp7c bxCJC+G5ZIDkMUb50WBHEUK56DHHPJW7mLL9C4K+kmGaErvdN2mLQKS2v/OR9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642168029; a=rsa-sha256; cv=none; b=xP9q3/g+81SAFQJuJawUOHqhL4ug1wCWc9VPEm1g/McUrFpM5ijPGapE+1wAuuF6klbTJC mfoR+mtz0SmQ4BuNmlyVVxwhSA71NRCNiqR7EUdMFhc6j8Y/UcBRGMuWf1Y5hAaJsIhBdO TFbg8Br79/dJWZ5lCb+zd9YhB7MEdH3E89O7/RhKf+kzaodF/5aNaM0P1kF3T4q/q+2SXF OTHW3cXj6Hj4LFtuqZ81FrHGwNmGqtSyrGrsO7BwZSkv9oP5M97p9/VP2jHV+LaNCbxLZ0 TJayVhFdQmLoJZAmxFn/uxMMqRk21HfWdU23ofeqfqm/d41WKr7bpEfrWMHBIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=b47fc941b0abcb6462c7a0a0d15c7fee5873eb1e commit b47fc941b0abcb6462c7a0a0d15c7fee5873eb1e Author: Emmanuel Vadot AuthorDate: 2021-07-05 13:50:39 +0000 Commit: Emmanuel Vadot CommitDate: 2022-01-14 13:44:36 +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 (cherry picked from commit b464c459eaf4e63a3abaaa1ecf51c9d6e9f7521e) --- 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);