summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorSaeed Mahameed <saeedm@mellanox.com>2016-11-04 02:48:42 +0300
committerDavid S. Miller <davem@davemloft.net>2016-11-04 21:59:35 +0300
commit87dc02551c509703123a60dd7f043d75e92a6aed (patch)
tree7b48de17ab2a8c791aa89fcfe8fc16200f502d81 /drivers/net
parent243d52126184b072a18fe2130ce0008f8aa3a340 (diff)
downloadlinux-87dc02551c509703123a60dd7f043d75e92a6aed.tar.xz
net/mlx5e: Fix XDP error path of mlx5e_open_channel()
In case of mlx5e_open_rq fails the error handling will jump to label err_close_xdp_sq and will try to close the xdp_sq unconditionally. xdp_sq is valid only in case of XDP use cases, i.e priv->xdp_prog is not null. To fix this in this patch we test xdp_sq validity prior to closing it. In addition we now close the xdp_sq.cq as well. Fixes: b5503b994ed5 ("net/mlx5e: XDP TX forwarding support") Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Reported-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index f4c687ce4c59..c83619d081d8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -1512,7 +1512,10 @@ static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix,
return 0;
err_close_xdp_sq:
- mlx5e_close_sq(&c->xdp_sq);
+ if (priv->xdp_prog) {
+ mlx5e_close_sq(&c->xdp_sq);
+ mlx5e_close_cq(&c->xdp_sq.cq);
+ }
err_close_sqs:
mlx5e_close_sqs(c);