Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jan 2015 07:01:52 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r277289 - head/sys/dev/ofw
Message-ID:  <201501170701.t0H71qAB071880@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501170701.t0H71qAB071880>