svn commit: r294729 - head/sys/dev/ofw
Zbigniew Bodek
zbb at semihalf.com
Mon Jan 25 14:59:30 UTC 2016
I forgot
Differential Revision: https://reviews.freebsd.org/D5065
2016-01-25 15:42 GMT+01:00 Zbigniew Bodek <zbb at freebsd.org>:
> Author: zbb
> Date: Mon Jan 25 14:42:44 2016
> New Revision: 294729
> URL: https://svnweb.freebsd.org/changeset/base/294729
>
> Log:
> Do not destroy input buffer of the OF_getencprop() function on error
>
> Currently when the OF_getprop() function returns with error,
> the caller (OF_getencprop()) still changes the buffer endiannes.
> This may destroy the default value passed in the input buffer if
> used on a Little Endian platform.
>
> Reviewed by: mmel
> Submitted by: Zbigniew Bodek <zbb at semihalf.com>
> Obtained from: Semihalf
> Sponsored by: Cavium
>
> Modified:
> head/sys/dev/ofw/openfirm.c
>
> Modified: head/sys/dev/ofw/openfirm.c
>
> ==============================================================================
> --- head/sys/dev/ofw/openfirm.c Mon Jan 25 14:13:28 2016 (r294728)
> +++ head/sys/dev/ofw/openfirm.c Mon Jan 25 14:42:44 2016 (r294729)
> @@ -394,6 +394,9 @@ OF_getencprop(phandle_t node, const char
> KASSERT(len % 4 == 0, ("Need a multiple of 4 bytes"));
>
> retval = OF_getprop(node, propname, buf, len);
> + if (retval <= 0)
> + return (retval);
> +
> for (i = 0; i < len/4; i++)
> buf[i] = be32toh(buf[i]);
>
> _______________________________________________
> svn-src-all at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscribe at freebsd.org"
>
More information about the svn-src-all
mailing list