From owner-svn-src-head@freebsd.org Fri Mar 10 19:15:58 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 85352D068DB; Fri, 10 Mar 2017 19:15:58 +0000 (UTC) (envelope-from gonzo@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 54A331D8E; Fri, 10 Mar 2017 19:15:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2AJFvDH099468; Fri, 10 Mar 2017 19:15:57 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2AJFv2V099467; Fri, 10 Mar 2017 19:15:57 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201703101915.v2AJFv2V099467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 10 Mar 2017 19:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315019 - head/sys/boot/fdt X-SVN-Group: head 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.23 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: Fri, 10 Mar 2017 19:15:58 -0000 Author: gonzo Date: Fri Mar 10 19:15:57 2017 New Revision: 315019 URL: https://svnweb.freebsd.org/changeset/base/315019 Log: [loader][fdt] Fix applying overlays without __local_fixups__ node Do not return error if __local_fixups__ node is missing in DTB overlay because local fixup data is optional. Reported by: Manuel Stuhn MFC after: 1 week Modified: head/sys/boot/fdt/fdt_overlay.c Modified: head/sys/boot/fdt/fdt_overlay.c ============================================================================== --- head/sys/boot/fdt/fdt_overlay.c Fri Mar 10 19:13:38 2017 (r315018) +++ head/sys/boot/fdt/fdt_overlay.c Fri Mar 10 19:15:57 2017 (r315019) @@ -358,21 +358,26 @@ static int fdt_overlay_do_local_fixups(void *main_fdtp, void *overlay_fdtp) { int overlay_local_fixups_o; - int len; + int len, rv; const char *fixups; uint32_t phandle_offset; overlay_local_fixups_o = fdt_path_offset(overlay_fdtp, "/__local_fixups__"); - if (overlay_local_fixups_o < 0) - return (-1); + if (overlay_local_fixups_o < 0) { + /* If not local fixups - do nothing */ + if (overlay_local_fixups_o == -FDT_ERR_NOTFOUND) + return (0); + return (overlay_local_fixups_o); + } phandle_offset = fdt_max_phandle(main_fdtp); fdt_increase_phandles(overlay_fdtp, phandle_offset); fixups = fdt_getprop_w(overlay_fdtp, overlay_local_fixups_o, "fixup", &len); if (fixups) { - if (fdt_do_local_fixup(overlay_fdtp, fixups, len, phandle_offset) < 0) - return (-1); + rv = fdt_do_local_fixup(overlay_fdtp, fixups, len, phandle_offset); + if (rv < 0) + return (rv); } return (0);