提交 ec0a3c7d 编写于 作者: A Aya Levin 提交者: Xie XiuQi

net/mlx5e: IPoIB, Add error path in mlx5_rdma_setup_rn

[ Upstream commit ef1ce7d7b67b46661091c7ccc0396186b7a247ef ]

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

Fixes: 48935bbb ("net/mlx5e: IPoIB, Add netdevice profile skeleton")
Signed-off-by: NAya Levin <ayal@mellanox.com>
Reviewed-by: NFeras Daoud <ferasda@mellanox.com>
Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 efe1b1c1
...@@ -705,7 +705,9 @@ struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev, ...@@ -705,7 +705,9 @@ struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev,
profile->init(mdev, netdev, profile, ipriv); profile->init(mdev, netdev, profile, 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 */
...@@ -721,6 +723,11 @@ struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev, ...@@ -721,6 +723,11 @@ struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev,
return netdev; return netdev;
detach:
profile->cleanup(epriv);
if (ipriv->sub_interface)
return NULL;
mlx5e_destroy_mdev_resources(mdev);
destroy_ht: destroy_ht:
mlx5i_pkey_qpn_ht_cleanup(netdev); mlx5i_pkey_qpn_ht_cleanup(netdev);
destroy_wq: destroy_wq:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册