Commit a7ecbe9
firewire: core: extend card->lock in fw_core_handle_bus_reset
card->local_node and card->bm_retries are both always accessed under
card->lock.
fw_core_handle_bus_reset has a check whose condition depends on
card->local_node and whose body writes to card->bm_retries.
Both of these accesses are not under card->lock. Move the lock acquiring
of card->lock to before this check such that these accesses do happen
when card->lock is held.
fw_destroy_nodes is called inside the check.
Since fw_destroy_nodes already acquires card->lock inside its function
body, move this out to the callsites of fw_destroy_nodes.
Also add a comment to indicate which locking is necessary when calling
fw_destroy_nodes.
Cc: <stable@vger.kernel.org>
Signed-off-by: Niels Dossche <dossche.niels@gmail.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20220409041243.603210-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>1 parent 9423973 commit a7ecbe9
2 files changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
| 671 | + | |
671 | 672 | | |
672 | 673 | | |
673 | 674 | | |
| |||
682 | 683 | | |
683 | 684 | | |
684 | 685 | | |
| 686 | + | |
685 | 687 | | |
| 688 | + | |
686 | 689 | | |
687 | 690 | | |
688 | 691 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| 378 | + | |
378 | 379 | | |
379 | 380 | | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | 381 | | |
384 | 382 | | |
385 | 383 | | |
386 | 384 | | |
387 | | - | |
388 | 385 | | |
389 | 386 | | |
390 | 387 | | |
| |||
510 | 507 | | |
511 | 508 | | |
512 | 509 | | |
| 510 | + | |
| 511 | + | |
513 | 512 | | |
514 | 513 | | |
515 | 514 | | |
| |||
521 | 520 | | |
522 | 521 | | |
523 | 522 | | |
524 | | - | |
525 | | - | |
526 | 523 | | |
527 | 524 | | |
528 | 525 | | |
| |||
0 commit comments