summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2018-04-26 13:00:30 +0200
committerRob Herring <robh@kernel.org>2018-04-26 21:18:13 -0500
commit83ef4777f5ff3689e6e52d3913a13d79aa25f1b5 (patch)
tree59e9979916a0d2c16f9b90cb8147e63250215a18 /Documentation
parent970f04c840f6004a1a956c1a836792a341d63eae (diff)
of: overlay: Stop leaking resources on overlay removal
Only the overlay notifier callbacks have a chance to potentially get hold of references to those two resources, but they are not supposed to store them beyond OF_OVERLAY_POST_REMOVE. Document the overlay notifier API, its constraint regarding pointer lifetime, and then remove intentional leaks of ovcs->overlay_tree and ovcs->fdt from free_overlay_changeset. See also https://lkml.org/lkml/2018/4/23/1063 and following. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Frank Rowand <frowand.list@gmail.com> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/devicetree/overlay-notes.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/devicetree/overlay-notes.txt b/Documentation/devicetree/overlay-notes.txt
index a4feb6dde8cd..725fb8d255c1 100644
--- a/Documentation/devicetree/overlay-notes.txt
+++ b/Documentation/devicetree/overlay-notes.txt
@@ -98,6 +98,14 @@ Finally, if you need to remove all overlays in one-go, just call
of_overlay_remove_all() which will remove every single one in the correct
order.
+In addition, there is the option to register notifiers that get called on
+overlay operations. See of_overlay_notifier_register/unregister and
+enum of_overlay_notify_action for details.
+
+Note that a notifier callback is not supposed to store pointers to a device
+tree node or its content beyond OF_OVERLAY_POST_REMOVE corresponding to the
+respective node it received.
+
Overlay DTS Format
------------------