Commit cb04444
vfio/mlx5: Fix unwind flows in mlx5vf_pci_save/resume_device_data()
Fix unwind flows in mlx5vf_pci_save_device_data() and
mlx5vf_pci_resume_device_data() to avoid freeing the migf pointer at the
'end' label, as this will be handled by fput(migf->filp) through
mlx5vf_release_file().
To ensure mlx5vf_release_file() functions correctly, move the
initialization of migf fields (such as migf->lock) to occur before any
potential unwind flow, as these fields may be accessed within
mlx5vf_release_file().
Fixes: 9945a67 ("vfio/mlx5: Refactor PD usage")
Signed-off-by: Yishai Hadas <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>1 parent 22e87bf commit cb04444
1 file changed
+17
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
643 | | - | |
| 643 | + | |
| 644 | + | |
644 | 645 | | |
645 | 646 | | |
646 | 647 | | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | 648 | | |
652 | 649 | | |
653 | 650 | | |
| |||
663 | 660 | | |
664 | 661 | | |
665 | 662 | | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
666 | 668 | | |
667 | 669 | | |
668 | 670 | | |
| |||
692 | 694 | | |
693 | 695 | | |
694 | 696 | | |
695 | | - | |
| 697 | + | |
696 | 698 | | |
697 | | - | |
698 | | - | |
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
| |||
1016 | 1016 | | |
1017 | 1017 | | |
1018 | 1018 | | |
1019 | | - | |
| 1019 | + | |
| 1020 | + | |
1020 | 1021 | | |
1021 | 1022 | | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
1022 | 1028 | | |
1023 | 1029 | | |
1024 | 1030 | | |
1025 | | - | |
| 1031 | + | |
1026 | 1032 | | |
1027 | 1033 | | |
1028 | 1034 | | |
| |||
1041 | 1047 | | |
1042 | 1048 | | |
1043 | 1049 | | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | 1050 | | |
1050 | 1051 | | |
1051 | 1052 | | |
1052 | 1053 | | |
1053 | 1054 | | |
1054 | | - | |
| 1055 | + | |
1055 | 1056 | | |
1056 | | - | |
1057 | | - | |
1058 | 1057 | | |
1059 | 1058 | | |
1060 | 1059 | | |
| |||
0 commit comments