Unverified Commit 823c81d4 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12200 CVE-2024-38608

Merge Pull Request from: @ci-robot 
 
PR sync from: Liu Jian <liujian56@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/DX3BYMGJI4PXQKFRQNJJMRDEQ2JJJOLH/ 
CVE-2024-38608

Shay Drory (1):
  net/mlx5e: Fix netif state handling

Tariq Toukan (1):
  net/mlx5e: Add wrapping for auxiliary_driver ops and remove unused
    args


-- 
2.34.1
 
https://gitee.com/src-openeuler/kernel/issues/IA6S7G 
 
Link:https://gitee.com/openeuler/kernel/pulls/12200

 

Reviewed-by: default avatarYue Haibing <yuehaibing@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents e16595b5 62ebca4d
Loading
Loading
Loading
Loading
+16 −8
Original line number Diff line number Diff line
@@ -6006,14 +6006,14 @@ static int mlx5e_resume(struct auxiliary_device *adev)
	return 0;
}

static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state)
static int _mlx5e_suspend(struct auxiliary_device *adev, bool pre_netdev_reg)
{
	struct mlx5e_dev *mlx5e_dev = auxiliary_get_drvdata(adev);
	struct mlx5e_priv *priv = mlx5e_dev->priv;
	struct net_device *netdev = priv->netdev;
	struct mlx5_core_dev *mdev = priv->mdev;

	if (!netif_device_present(netdev)) {
	if (!pre_netdev_reg && !netif_device_present(netdev)) {
		if (test_bit(MLX5E_STATE_DESTROYING, &priv->state))
			mlx5e_destroy_mdev_resources(mdev);
		return -ENODEV;
@@ -6024,15 +6024,18 @@ static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state)
	return 0;
}

static int mlx5e_probe(struct auxiliary_device *adev,
		       const struct auxiliary_device_id *id)
static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state)
{
	return _mlx5e_suspend(adev, false);
}

static int _mlx5e_probe(struct auxiliary_device *adev)
{
	struct mlx5_adev *edev = container_of(adev, struct mlx5_adev, adev);
	const struct mlx5e_profile *profile = &mlx5e_nic_profile;
	struct mlx5_core_dev *mdev = edev->mdev;
	struct mlx5e_dev *mlx5e_dev;
	struct net_device *netdev;
	pm_message_t state = {};
	struct mlx5e_priv *priv;
	int err;

@@ -6087,7 +6090,7 @@ static int mlx5e_probe(struct auxiliary_device *adev,
	return 0;

err_resume:
	mlx5e_suspend(adev, state);
	_mlx5e_suspend(adev, true);
err_profile_cleanup:
	profile->cleanup(priv);
err_destroy_netdev:
@@ -6099,16 +6102,21 @@ static int mlx5e_probe(struct auxiliary_device *adev,
	return err;
}

static int mlx5e_probe(struct auxiliary_device *adev,
		       const struct auxiliary_device_id *id)
{
	return _mlx5e_probe(adev);
}

static void mlx5e_remove(struct auxiliary_device *adev)
{
	struct mlx5e_dev *mlx5e_dev = auxiliary_get_drvdata(adev);
	struct mlx5e_priv *priv = mlx5e_dev->priv;
	pm_message_t state = {};

	mlx5_core_uplink_netdev_set(priv->mdev, NULL);
	mlx5e_dcbnl_delete_app(priv);
	unregister_netdev(priv->netdev);
	mlx5e_suspend(adev, state);
	_mlx5e_suspend(adev, false);
	priv->profile->cleanup(priv);
	mlx5e_destroy_netdev(priv);
	mlx5e_devlink_port_unregister(mlx5e_dev);