From owner-svn-src-head@FreeBSD.ORG Sat Jan 17 07:01:52 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B319B673; Sat, 17 Jan 2015 07:01:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 9EA79AD; Sat, 17 Jan 2015 07:01:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0H71qEV071881; Sat, 17 Jan 2015 07:01:52 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0H71qAB071880; Sat, 17 Jan 2015 07:01:52 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201501170701.t0H71qAB071880@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 17 Jan 2015 07:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277289 - head/sys/dev/ofw 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.18-1 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: Sat, 17 Jan 2015 07:01:52 -0000 Author: nwhitehorn Date: Sat Jan 17 07:01:51 2015 New Revision: 277289 URL: https://svnweb.freebsd.org/changeset/base/277289 Log: Return an appropriate error code in the case of a missing property rather than random numbers. MFC after: 1 week Modified: head/sys/dev/ofw/ofw_fdt.c Modified: head/sys/dev/ofw/ofw_fdt.c ============================================================================== --- head/sys/dev/ofw/ofw_fdt.c Sat Jan 17 06:43:30 2015 (r277288) +++ head/sys/dev/ofw/ofw_fdt.c Sat Jan 17 07:01:51 2015 (r277289) @@ -238,6 +238,9 @@ ofw_fdt_getproplen(ofw_t ofw, phandle_t return (sizeof(uint64_t)*2*fdt_num_mem_rsv(fdtp)); } + if (prop == NULL) + return (-1); + return (len); }