{
struct mlx5_flow_root_namespace *root_ns;
struct fs_prio *prio;
+ int ret;
int i;
steering->rdma_transport_rx_root_ns[vport_idx] =
for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) {
prio = fs_create_prio(&root_ns->ns, i, 1);
- if (IS_ERR(prio))
- return PTR_ERR(prio);
+ if (IS_ERR(prio)) {
+ ret = PTR_ERR(prio);
+ goto err;
+ }
}
set_prio_attrs(root_ns);
return 0;
+
+err:
+ cleanup_root_ns(root_ns);
+ return ret;
}
static int
{
struct mlx5_flow_root_namespace *root_ns;
struct fs_prio *prio;
+ int ret;
int i;
steering->rdma_transport_tx_root_ns[vport_idx] =
for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) {
prio = fs_create_prio(&root_ns->ns, i, 1);
- if (IS_ERR(prio))
- return PTR_ERR(prio);
+ if (IS_ERR(prio)) {
+ ret = PTR_ERR(prio);
+ goto err;
+ }
}
set_prio_attrs(root_ns);
return 0;
+
+err:
+ cleanup_root_ns(root_ns);
+ return ret;
}
static int init_rdma_transport_rx_root_ns(struct mlx5_flow_steering *steering)