Commit a42a583
committed
thermal: core: Reference count the zone in thermal_zone_get_by_id()
There are places in the thermal netlink code where nothing prevents
the thermal zone object from going away while being accessed after it
has been returned by thermal_zone_get_by_id().
To address this, make thermal_zone_get_by_id() get a reference on the
thermal zone device object to be returned with the help of get_device(),
under thermal_list_lock, and adjust all of its callers to this change
with the help of the cleanup.h infrastructure.
Fixes: 1ce50e7 ("thermal: core: genetlink support for events/cmd/sampling")
Cc: 6.8+ <[email protected]> # 6.8+
Signed-off-by: Rafael J. Wysocki <[email protected]>
Reviewed-by: Lukasz Luba <[email protected]>
Link: https://patch.msgid.link/[email protected]1 parent 9852d85 commit a42a583
File tree
3 files changed
+7
-6
lines changed- drivers/thermal
3 files changed
+7
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
728 | 728 | | |
729 | 729 | | |
730 | 730 | | |
| 731 | + | |
731 | 732 | | |
732 | 733 | | |
733 | 734 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
197 | 200 | | |
198 | 201 | | |
199 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
447 | 446 | | |
448 | 447 | | |
449 | 448 | | |
| |||
452 | 451 | | |
453 | 452 | | |
454 | 453 | | |
455 | | - | |
| 454 | + | |
456 | 455 | | |
457 | 456 | | |
458 | 457 | | |
| |||
488 | 487 | | |
489 | 488 | | |
490 | 489 | | |
491 | | - | |
492 | 490 | | |
493 | 491 | | |
494 | 492 | | |
495 | 493 | | |
496 | 494 | | |
497 | 495 | | |
498 | 496 | | |
499 | | - | |
| 497 | + | |
500 | 498 | | |
501 | 499 | | |
502 | 500 | | |
| |||
514 | 512 | | |
515 | 513 | | |
516 | 514 | | |
517 | | - | |
518 | 515 | | |
519 | 516 | | |
520 | 517 | | |
521 | 518 | | |
522 | 519 | | |
523 | 520 | | |
524 | 521 | | |
525 | | - | |
| 522 | + | |
526 | 523 | | |
527 | 524 | | |
528 | 525 | | |
| |||
0 commit comments