From: Rob Herring <robh@kernel.org>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: devicetree@vger.kernel.org, xen-devel@lists.xenproject.org,
Stefano Stabellini <stefano.stabellini@xilinx.com>,
robh+dt@kernel.org, julien@xen.org, frowand.list@gmail.com
Subject: Re: [PATCH v2] of: of_property_read_string return -ENODATA when !length
Date: Tue, 19 Apr 2022 08:19:32 -0500 [thread overview]
Message-ID: <Yl625EnFl0/MChux@robh.at.kernel.org> (raw)
In-Reply-To: <20220416003028.1315268-1-sstabellini@kernel.org>
On Fri, 15 Apr 2022 17:30:28 -0700, Stefano Stabellini wrote:
> From: Stefano Stabellini <stefano.stabellini@xilinx.com>
>
> When the length of the string is zero of_property_read_string should
> return -ENODATA according to the description of the function.
>
> However, of_property_read_string doesn't check prop->length. If
> prop->length is zero, return -ENODATA.
>
> Without this patch the following command in u-boot:
>
> fdt set /chosen/node property-name
>
> results in of_property_read_string returning -EILSEQ when attempting to
> read property-name. With this patch, it returns -ENODATA as expected.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
> ---
> Changes in v2:
> - use prop instead pp
> - drop value check
> - update function header documentation
> ---
> drivers/of/property.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
Applied, thanks!
prev parent reply other threads:[~2022-04-19 13:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-16 0:30 [PATCH v2] of: of_property_read_string return -ENODATA when !length Stefano Stabellini
2022-04-19 13:19 ` Rob Herring [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yl625EnFl0/MChux@robh.at.kernel.org \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=julien@xen.org \
--cc=robh+dt@kernel.org \
--cc=sstabellini@kernel.org \
--cc=stefano.stabellini@xilinx.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).