Skip to content
Commit f688d619 authored by Stefano Stabellini's avatar Stefano Stabellini Committed by Rob Herring
Browse files

of: of_property_read_string return -ENODATA when !length



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: default avatarStefano Stabellini <stefano.stabellini@xilinx.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220416003028.1315268-1-sstabellini@kernel.org
parent f2701e0f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment