Commit 5a637c0b authored by Aya Levin's avatar Aya Levin Committed by Greg Kroah-Hartman

net/mlx5e: IPoIB, Add error path in mlx5_rdma_setup_rn

[ Upstream commit ef1ce7d7 ]

Check return value from mlx5e_attach_netdev, add error path on failure.

Fixes: 48935bbb ("net/mlx5e: IPoIB, Add netdevice profile skeleton")
Signed-off-by: default avatarAya Levin <ayal@mellanox.com>
Reviewed-by: default avatarFeras Daoud <ferasda@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 98ecf34e
...@@ -698,7 +698,9 @@ static int mlx5_rdma_setup_rn(struct ib_device *ibdev, u8 port_num, ...@@ -698,7 +698,9 @@ static int mlx5_rdma_setup_rn(struct ib_device *ibdev, u8 port_num,
prof->init(mdev, netdev, prof, ipriv); prof->init(mdev, netdev, prof, ipriv);
mlx5e_attach_netdev(epriv); err = mlx5e_attach_netdev(epriv);
if (err)
goto detach;
netif_carrier_off(netdev); netif_carrier_off(netdev);
/* set rdma_netdev func pointers */ /* set rdma_netdev func pointers */
...@@ -714,6 +716,11 @@ static int mlx5_rdma_setup_rn(struct ib_device *ibdev, u8 port_num, ...@@ -714,6 +716,11 @@ static int mlx5_rdma_setup_rn(struct ib_device *ibdev, u8 port_num,
return 0; return 0;
detach:
prof->cleanup(epriv);
if (ipriv->sub_interface)
return err;
mlx5e_destroy_mdev_resources(mdev);
destroy_ht: destroy_ht:
mlx5i_pkey_qpn_ht_cleanup(netdev); mlx5i_pkey_qpn_ht_cleanup(netdev);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment