提交 40d25904 编写于 作者: J Jiri Pirko 提交者: David S. Miller

mlxsw: spectrum_router: Fix error path in mlxsw_sp_router_init

When neigh_init fails, we have to do proper cleanup including
router_fini call.

Fixes: 6cf3c971 ("mlxsw: spectrum_router: Add private neigh table")
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Acked-by: NIdo Schimmel <idosch@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2c2c8e33
......@@ -1517,7 +1517,14 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp)
return err;
mlxsw_sp_lpm_init(mlxsw_sp);
mlxsw_sp_vrs_init(mlxsw_sp);
return mlxsw_sp_neigh_init(mlxsw_sp);
err = mlxsw_sp_neigh_init(mlxsw_sp);
if (err)
goto err_neigh_init;
return 0;
err_neigh_init:
__mlxsw_sp_router_fini(mlxsw_sp);
return err;
}
void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册