of: unittest: for strings, account for trailing \0 in property length field
authorStefan M Schaeckeler <sschaeck@cisco.com>
Mon, 21 May 2018 23:26:14 +0000 (16:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Jul 2018 09:24:52 +0000 (11:24 +0200)
commit6ba51909693c7bf8c463b9c90f7f8726b710fe42
tree58428b0e96de5b41fec017bd3a50f7ddff9cc8cb
parent4910cc250b4dab82b42a743377d359abaee07b73
of: unittest: for strings, account for trailing \0 in property length field

commit 3b9cf7905fe3ab35ab437b5072c883e609d3498d upstream.

For strings, account for trailing \0 in property length field:

This is consistent with how dtc builds string properties.

Function __of_prop_dup() would misbehave on such properties as it duplicates
properties based on the property length field creating new string values
without trailing \0s.

Signed-off-by: Stefan M Schaeckeler <sschaeck@cisco.com>
Reviewed-by: Frank Rowand <frank.rowand@sony.com>
Tested-by: Frank Rowand <frank.rowand@sony.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/of/unittest.c