of: dynamic: Fix race in getting old property when updating property
authorRob Herring <robh@kernel.org>
Fri, 18 Aug 2023 20:40:59 +0000 (15:40 -0500)
committerRob Herring <robh@kernel.org>
Mon, 21 Aug 2023 22:09:57 +0000 (17:09 -0500)
commit420f0de965a80b7060d23d2c23cddaed4e4ad2eb
tree65b458154bff425907f822c59c39a35a4ca822ac
parent27a02f265e25a6d6136d07d0187fd02fe1691fd7
of: dynamic: Fix race in getting old property when updating property

__of_update_property() returns the existing property if there is one, but
that value is never added to the changeset. Updates work because the
existing property was also retrieved before in of_changeset_action(),
but that is racy as of_changeset_action() doesn't hold any locks. The
property could be changed before the changeset is applied.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230801-dt-changeset-fixes-v3-4-5f0410e007dd@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/dynamic.c