Commit e90c369
thermal/drivers/broadcom: Fix race between removal and clock disable
During the probe, driver enables clocks necessary to access registers
(in get_temp()) and then registers thermal zone with managed-resources
(devm) interface. Removal of device is not done in reversed order,
because:
1. Clock will be disabled in driver remove() callback - thermal zone is
still registered and accessible to users,
2. devm interface will unregister thermal zone.
This leaves short window between (1) and (2) for accessing the
get_temp() callback with disabled clock.
Fix this by enabling clock also via devm-interface, so entire cleanup
path will be in proper, reversed order.
Fixes: 8454c8c ("thermal/drivers/bcm2835: Remove buggy call to thermal_of_zone_unregister")
Cc: [email protected]
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Daniel Lezcano <[email protected]>1 parent 6f48290 commit e90c369
1 file changed
+4
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | 196 | | |
201 | 197 | | |
202 | 198 | | |
| |||
211 | 207 | | |
212 | 208 | | |
213 | 209 | | |
214 | | - | |
| 210 | + | |
215 | 211 | | |
216 | 212 | | |
217 | 213 | | |
| |||
236 | 232 | | |
237 | 233 | | |
238 | 234 | | |
239 | | - | |
| 235 | + | |
240 | 236 | | |
241 | 237 | | |
242 | 238 | | |
| |||
269 | 265 | | |
270 | 266 | | |
271 | 267 | | |
272 | | - | |
| 268 | + | |
273 | 269 | | |
274 | 270 | | |
275 | 271 | | |
276 | 272 | | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | 273 | | |
284 | 274 | | |
285 | 275 | | |
286 | 276 | | |
287 | 277 | | |
288 | 278 | | |
289 | 279 | | |
290 | | - | |
291 | 280 | | |
292 | 281 | | |
293 | 282 | | |
| |||
0 commit comments