of: overlay: validate overlay properties #address-cells and #size-cells
authorFrank Rowand <frank.rowand@sony.com>
Fri, 5 Oct 2018 03:32:04 +0000 (20:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Jun 2019 07:17:24 +0000 (09:17 +0200)
commit15151d0013c9280921476bbeb7b43cfcc96008d6
tree174659502a463c0e2d4afe77d49cdff4adf8b05b
parent26dace362e7fb77a51039e91d9e15ab90b0eaac0
of: overlay: validate overlay properties #address-cells and #size-cells

commit 6f75118800acf77f8ad6afec61ca1b2349ade371 upstream.

If overlay properties #address-cells or #size-cells are already in
the live devicetree for any given node, then the values in the
overlay must match the values in the live tree.

If the properties are already in the live tree then there is no
need to create a changeset entry to add them since they must
have the same value.  This reduces the memory used by the
changeset and eliminates a possible memory leak.

Tested-by: Alan Tull <atull@kernel.org>
Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/of/overlay.c
include/linux/of.h