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) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to