In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix the possible bioc_list memory leak during error
There are two possible ways to leak bioc memory on btrfs_ordered_extent::bioc_list:
- An error occurred for btrfs_insert_one_raid_extent()
- An ordered extent hit an IO error
Fix the problem by:
- Introduce a new helper, btrfs_cleanup_ordered_bioc_list()
- Call the above helper for btrfs_insert_raid_extent()
- Call the above helper for btrfs_finish_one_ordered()
This was reported by Sashiko when reviewing another patch.