Commit f5432d46 authored by Hao Lan's avatar Hao Lan Committed by Jiantao Xiao
Browse files

net: hns3: fix pointer cast to different type for wol

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7A712


CVE: NA

----------------------------------------------------------------------

The pointer to decs.data is __le32 (*)[6], is incompatible to
"struct hclge_wol_cfg_cmd *". So fix the pointer cast to
correct type for decs.data.

Signed-off-by: default avatarHao Lan <lanhao@huawei.com>
parent c06ba533
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -12083,7 +12083,7 @@ int hclge_get_wol_supported_mode(struct hclge_dev *hdev,

	hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_WOL_GET_SUPPORTED_MODE,
				   true);
	wol_supported_cmd = (struct hclge_query_wol_supported_cmd *)&desc.data;
	wol_supported_cmd = (struct hclge_query_wol_supported_cmd *)desc.data;

	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
	if (ret) {
@@ -12111,7 +12111,7 @@ int hclge_get_wol_cfg(struct hclge_dev *hdev, u32 *mode)
		return ret;
	}

	wol_cfg_cmd = (struct hclge_wol_cfg_cmd *)&desc.data;
	wol_cfg_cmd = (struct hclge_wol_cfg_cmd *)desc.data;
	*mode = le32_to_cpu(wol_cfg_cmd->wake_on_lan_mode);

	return 0;
@@ -12125,7 +12125,7 @@ static int hclge_set_wol_cfg(struct hclge_dev *hdev,
	int ret;

	hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_WOL_CFG, false);
	wol_cfg_cmd = (struct hclge_wol_cfg_cmd *)&desc.data;
	wol_cfg_cmd = (struct hclge_wol_cfg_cmd *)desc.data;
	wol_cfg_cmd->wake_on_lan_mode = cpu_to_le32(wol_info->wol_current_mode);
	wol_cfg_cmd->sopass_size = wol_info->wol_sopass_size;
	memcpy(&wol_cfg_cmd->sopass, wol_info->wol_sopass, SOPASS_MAX);