hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/scripts/coccinelle/free/devm_free.cocci
....@@ -1,8 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /// Find uses of standard freeing functons on values allocated using devm_
23 /// functions. Values allocated using the devm_functions are freed when
34 /// the device is detached, and thus the use of the standard freeing
45 /// function would cause a double free.
5
-/// See Documentation/driver-model/devres.txt for more information.
6
+/// See Documentation/driver-api/driver-model/devres.rst for more information.
67 ///
78 /// A difficulty of detecting this problem is that the standard freeing
89 /// function might be called from a different function than the one
....@@ -14,8 +15,8 @@
1415 /// less reliable in these cases.
1516 ///
1617 // Confidence: Moderate
17
-// Copyright: (C) 2011 Julia Lawall, INRIA/LIP6. GPLv2.
18
-// Copyright: (C) 2011 Gilles Muller, INRIA/LiP6. GPLv2.
18
+// Copyright: (C) 2011 Julia Lawall, INRIA/LIP6.
19
+// Copyright: (C) 2011 Gilles Muller, INRIA/LiP6.
1920 // URL: http://coccinelle.lip6.fr/
2021 // Comments:
2122 // Options: --no-includes --include-headers
....@@ -51,8 +52,6 @@
5152 |
5253 x = devm_ioremap(...)
5354 |
54
- x = devm_ioremap_nocache(...)
55
-|
5655 x = devm_ioport_map(...)
5756 )
5857
....@@ -84,17 +83,13 @@
8483 |
8584 x = ioremap(...)
8685 |
87
- x = ioremap_nocache(...)
88
-|
8986 x = ioport_map(...)
9087 )
9188 ...
9289 (
9390 kfree@p(x)
9491 |
95
- kzfree@p(x)
96
-|
97
- __krealloc@p(x, ...)
92
+ kfree_sensitive@p(x)
9893 |
9994 krealloc@p(x, ...)
10095 |
....@@ -117,9 +112,7 @@
117112 (
118113 * kfree@p(x)
119114 |
120
-* kzfree@p(x)
121
-|
122
-* __krealloc@p(x, ...)
115
+* kfree_sensitive@p(x)
123116 |
124117 * krealloc@p(x, ...)
125118 |