Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Jul 2015 00:58:51 +0000 (UTC)
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r285865 - head/sys/dev/ofw
Message-ID:  <201507250058.t6P0wpe1026326@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gonzo
Date: Sat Jul 25 00:58:50 2015
New Revision: 285865
URL: https://svnweb.freebsd.org/changeset/base/285865

Log:
  OF_getencprop_alloc shouldn't be used to get string value. If string
  length + 1 is not divisible by 4 this function returns NULL property
  value. Otherwise - string with each 4 letters inverted

Modified:
  head/sys/dev/ofw/ofw_bus_subr.c

Modified: head/sys/dev/ofw/ofw_bus_subr.c
==============================================================================
--- head/sys/dev/ofw/ofw_bus_subr.c	Sat Jul 25 00:21:29 2015	(r285864)
+++ head/sys/dev/ofw/ofw_bus_subr.c	Sat Jul 25 00:58:50 2015	(r285865)
@@ -395,7 +395,7 @@ ofw_bus_reg_to_rl(device_t dev, phandle_
 	 * This may be just redundant when having ofw_bus_devinfo
 	 * but makes this routine independent of it.
 	 */
-	ret = OF_getencprop_alloc(node, "name", sizeof(*name), (void **)&name);
+	ret = OF_getprop_alloc(node, "name", sizeof(*name), (void **)&name);
 	if (ret == -1)
 		name = NULL;
 
@@ -511,7 +511,7 @@ ofw_bus_find_child(phandle_t start, cons
 	phandle_t child;
 
 	for (child = OF_child(start); child != 0; child = OF_peer(child)) {
-		ret = OF_getencprop_alloc(child, "name", sizeof(*name), (void **)&name);
+		ret = OF_getprop_alloc(child, "name", sizeof(*name), (void **)&name);
 		if (ret == -1)
 			continue;
 		if (strcmp(name, child_name) == 0) {



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