diff options
author | Shengzhou Liu <Shengzhou.Liu@freescale.com> | 2015-04-07 09:01:32 (GMT) |
---|---|---|
committer | Honghua Yin <Hong-Hua.Yin@freescale.com> | 2015-04-08 00:54:32 (GMT) |
commit | 9c3d11c6a2f1e86927cd762dfaa696c82def8e95 (patch) | |
tree | 8642e5c30a9e2add2f4d8f18d2b350350d00533d /drivers/of | |
parent | 647d9bcbf07d8442c12788b84045d62689acae11 (diff) | |
download | linux-fsl-qoriq-9c3d11c6a2f1e86927cd762dfaa696c82def8e95.tar.xz |
of: fix of_property_read_string
in of_property_read_string function, strnlen(prop->value, prop->length)
is always less or equal to prop->length and we should allow the '=='
condition, so let's remove the original unreasonable condition, otherwise
it was causing kernel crash.
Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Change-Id: I4adf0d8ed7c3185b942d8da0f671faf7b5272720
Reviewed-on: http://git.am.freescale.net:8181/34543
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Xiaobo Xie <X.Xie@freescale.com>
Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/base.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index 6c18ab2..17fcc72 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1049,8 +1049,6 @@ int of_property_read_string(struct device_node *np, const char *propname, return -EINVAL; if (!prop->value) return -ENODATA; - if (strnlen(prop->value, prop->length) >= prop->length) - return -EILSEQ; *out_string = prop->value; return 0; } |