Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
providers/mlx5: Fix warning: 'prev' may be used uninitialized
This patch addresses a compiler warning indicating that the 'prev' variable may be used uninitialized in the function dr_vports_table_del_wire. Although this warning is a false positive, it is important to resolve it to prevent potential confusion and maintain code quality. The 'while (vport)' loop is intended to start from the second element of the linked list, as the first element is already checked by a preceding condition. By initializing 'prev' to the first element and 'vport' to 'prev->next', we ensure that the loop logic remains correct and the warning is eliminated. This change does not alter the functionality of the code but enhances its clarity and robustness by ensuring all variables are properly initialized before use. Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
- Loading branch information