summaryrefslogtreecommitdiff
path: root/Documentation/driver-model
diff options
context:
space:
mode:
authorNicholas Mc Guire <hofrat@osadl.org>2018-12-01 15:44:29 +0300
committerJonathan Corbet <corbet@lwn.net>2018-12-06 20:14:01 +0300
commit41c31f6a5945a4b005302e01d47c97bcf5d604ac (patch)
treecee9e50d15b9da286c2c8e6337e1393502efaa71 /Documentation/driver-model
parentfdf0345e59f9c0fe02ceae580f04c4f22e10eb0d (diff)
downloadlinux-41c31f6a5945a4b005302e01d47c97bcf5d604ac.tar.xz
Documentation: devres: note checking needs when converting
There are a number of cases where conversions to devm_* API have been done but developers forgot that this conversion may imply that return values need to be checked for failure of internal resource handling like allocation. While this should be clear, it does seem to be a relatively common issue with API conversions or maybe "managed" is being misunderstood ? So add a note to make the scope of "managed" clear. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/driver-model')
-rw-r--r--Documentation/driver-model/devres.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
index 43681ca0837f..f106c49c849d 100644
--- a/Documentation/driver-model/devres.txt
+++ b/Documentation/driver-model/devres.txt
@@ -132,6 +132,13 @@ devres. Complexity is shifted from less maintained low level drivers
to better maintained higher layer. Also, as init failure path is
shared with exit path, both can get more testing.
+Note though that when converting current calls or assignments to
+managed devm_* versions it is up to you to check if internal operations
+like allocating memory, have failed. Managed resources pertains to the
+freeing of these resources *only* - all other checks needed are still
+on you. In some cases this may mean introducing checks that were not
+necessary before moving to the managed devm_* calls.
+
3. Devres group
---------------