Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vfio: Fix smatch errors in vfio_combine_iova_ranges()
smatch reports: vfio_combine_iova_ranges() error: uninitialized symbol 'last'. vfio_combine_iova_ranges() error: potentially dereferencing uninitialized 'comb_end'. vfio_combine_iova_ranges() error: potentially dereferencing uninitialized 'comb_start'. These errors are only reachable via invalid input, in the case of @last when we receive an empty rb-tree or for @comb_{start,end} if the rb-tree is empty or otherwise fails to produce a second node that reduces the gap. Add tests with warnings for these cases. Reported-by: Cong Liu <[email protected]> Link: https://lore.kernel.org/all/[email protected] Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Brett Creeley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
- Loading branch information