Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 2016 15:59:08 +0100
From:      Zbigniew Bodek <zbb@semihalf.com>
To:        Zbigniew Bodek <zbb@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r294729 - head/sys/dev/ofw
Message-ID:  <CAG7dG%2ByWROeZ7uXDuS_hv4CkyrC=8H_ESeu=jg%2BsdaDz84SwFA@mail.gmail.com>
In-Reply-To: <201601251442.u0PEgi2t025216@repo.freebsd.org>
References:  <201601251442.u0PEgi2t025216@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
I forgot

Differential Revision: https://reviews.freebsd.org/D5065

2016-01-25 15:42 GMT+01:00 Zbigniew Bodek <zbb@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@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@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG7dG%2ByWROeZ7uXDuS_hv4CkyrC=8H_ESeu=jg%2BsdaDz84SwFA>