From owner-svn-src-head@freebsd.org Thu Dec 28 21:12:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CA49E808E5; Thu, 28 Dec 2017 21:12:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56F066B7AE; Thu, 28 Dec 2017 21:12:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBSLCRJP019794; Thu, 28 Dec 2017 21:12:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBSLCRqx019793; Thu, 28 Dec 2017 21:12:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201712282112.vBSLCRqx019793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 28 Dec 2017 21:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327299 - head/stand/fdt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/fdt X-SVN-Commit-Revision: 327299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2017 21:12:28 -0000 Author: kevans Date: Thu Dec 28 21:12:27 2017 New Revision: 327299 URL: https://svnweb.freebsd.org/changeset/base/327299 Log: stand/fdt: Avoid bailout when dtbo has no fixups In the case of a simple dtbo where fragment uses target-path and the overlay contains no references, /__fixups__ will not be included by either our dtc or dtc from ports, but the file still has valid fragments to be applied. Additional testing found that /__symbols__ might also be omitted if it's empty, which is not necessarily an error. Reviewed by: gonzo, imp Differential Revision: https://reviews.freebsd.org/D13663 Modified: head/stand/fdt/fdt_overlay.c Modified: head/stand/fdt/fdt_overlay.c ============================================================================== --- head/stand/fdt/fdt_overlay.c Thu Dec 28 21:09:36 2017 (r327298) +++ head/stand/fdt/fdt_overlay.c Thu Dec 28 21:12:27 2017 (r327299) @@ -324,10 +324,16 @@ fdt_overlay_do_fixups(void *main_fdtp, void *overlay_f main_symbols_o = fdt_path_offset(main_fdtp, "/__symbols__"); overlay_fixups_o = fdt_path_offset(overlay_fdtp, "/__fixups__"); - if (main_symbols_o < 0) + if (main_symbols_o < 0) { + if (main_symbols_o == -FDT_ERR_NOTFOUND) + return (0); return (-1); - if (overlay_fixups_o < 0) + } + if (overlay_fixups_o < 0) { + if (overlay_fixups_o == -FDT_ERR_NOTFOUND) + return (0); return (-1); + } for (fixup_prop_o = fdt_first_property_offset(overlay_fdtp, overlay_fixups_o); fixup_prop_o >= 0;