Commit 2c3b266
IB/mlx5: Fix transport-domain rollback and initialize lb mutex earlier
[ Upstream commit e793891 ]
mlx5_ib_alloc_transport_domain() allocates a transport domain and then
may fail in mlx5_ib_enable_lb(). In that case, the allocated TD is leaked.
Fix this by deallocating the TD when mlx5_ib_enable_lb() returns an
error. Also return 0 explicitly in the no-loopback-capability success
branch, and move dev->lb.mutex initialization to mlx5_ib_stage_init_init().
Fixes: 146d2f1 ("IB/mlx5: Allocate a Transport Domain for each ucontext")
Signed-off-by: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 8ed0ce9 commit 2c3b266
1 file changed
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1785 | 1785 | | |
1786 | 1786 | | |
1787 | 1787 | | |
1788 | | - | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
1789 | 1793 | | |
1790 | | - | |
| 1794 | + | |
1791 | 1795 | | |
1792 | 1796 | | |
1793 | 1797 | | |
| |||
3791 | 3795 | | |
3792 | 3796 | | |
3793 | 3797 | | |
| 3798 | + | |
| 3799 | + | |
3794 | 3800 | | |
3795 | 3801 | | |
3796 | 3802 | | |
| |||
4006 | 4012 | | |
4007 | 4013 | | |
4008 | 4014 | | |
4009 | | - | |
4010 | | - | |
4011 | | - | |
4012 | | - | |
4013 | | - | |
4014 | 4015 | | |
4015 | 4016 | | |
4016 | 4017 | | |
| |||
0 commit comments