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:23:08 +0000 (11:23 +0200)
commitf92ec84c49f91756cbdd048c1a3136f15810cd94
tree651c17c09124e244b0a9660d4ef99601dec7c221
parentfb6786ce77ac4d65351832412703b8793e122f12
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