From owner-svn-src-all@FreeBSD.ORG Thu May 24 20:24:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5BD5C106566B; Thu, 24 May 2012 20:24:50 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46C098FC19; Thu, 24 May 2012 20:24:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OKOoDs058474; Thu, 24 May 2012 20:24:50 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OKOoFQ058472; Thu, 24 May 2012 20:24:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205242024.q4OKOoFQ058472@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 May 2012 20:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235930 - head/sys/dev/fdt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 20:24:50 -0000 Author: marcel Date: Thu May 24 20:24:49 2012 New Revision: 235930 URL: http://svn.freebsd.org/changeset/base/235930 Log: Preset (clear) the ranges we're supposed to fill from the FDT. If a particular range (either I/O memory or I/O port) is not defined in the FDT, we're not handing uninitialized structures back to our caller. Modified: head/sys/dev/fdt/fdt_pci.c Modified: head/sys/dev/fdt/fdt_pci.c ============================================================================== --- head/sys/dev/fdt/fdt_pci.c Thu May 24 20:12:46 2012 (r235929) +++ head/sys/dev/fdt/fdt_pci.c Thu May 24 20:24:49 2012 (r235930) @@ -100,6 +100,14 @@ fdt_pci_ranges_decode(phandle_t node, st size_cells); tuples = len / tuple_size; + /* + * Initialize the ranges so that we don't have to worry about + * having them all defined in the FDT. In particular, it is + * perfectly fine not to want I/O space on PCI busses. + */ + bzero(io_space, sizeof(*io_space)); + bzero(mem_space, sizeof(*mem_space)); + rangesptr = &ranges[0]; offset_cells = 0; for (i = 0; i < tuples; i++) {