]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix XDP error path of mlx5e_open_channel()
authorSaeed Mahameed <saeedm@mellanox.com>
Thu, 3 Nov 2016 23:48:42 +0000 (01:48 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Nov 2016 18:59:35 +0000 (14:59 -0400)
commit5e98fb3d9e6fa97647cf46d2374289a89a663a8c
tree7b48de17ab2a8c791aa89fcfe8fc16200f502d81
parent0d1901a91313db9665fdbb99c939285863e32ff7
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: 5fa1fcacf9a2 ("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>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c