Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8ba53da authored by Aya Levin's avatar Aya Levin Committed by Greg Kroah-Hartman
Browse files

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: 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 a2aa162a
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -662,7 +662,9 @@ struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev,

	profile->init(mdev, netdev, profile, ipriv);

	mlx5e_attach_netdev(epriv);
	err = mlx5e_attach_netdev(epriv);
	if (err)
		goto detach;
	netif_carrier_off(netdev);

	/* set rdma_netdev func pointers */
@@ -678,6 +680,11 @@ struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev,

	return netdev;

detach:
	profile->cleanup(epriv);
	if (ipriv->sub_interface)
		return NULL;
	mlx5e_destroy_mdev_resources(mdev);
destroy_ht:
	mlx5i_pkey_qpn_ht_cleanup(netdev);
destroy_wq: