提交 7635f442 编写于 作者: H Hao Lan 提交者: openeuler-sync-bot

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: NHao Lan <lanhao@huawei.com>
(cherry picked from commit f5432d46)
上级 4ac8d141
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册