From 14f15981fd8f619fda39b563dc7f3e8fecfb28f8 Mon Sep 17 00:00:00 2001 From: Hao Lan Date: Tue, 13 Dec 2022 11:46:36 +0800 Subject: [PATCH 259/283] net: hns3: fix pointer cast to different type for wol driver inclusion category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I8EN49 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: Hao Lan Signed-off-by: Xiaodong Li --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 5b4014d808cb..989cb20a72d0 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -11656,7 +11656,7 @@ int hclge_get_wol_supported_mode(struct hclge_dev *hdev, u32 *wol_supported) 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) { @@ -11684,7 +11684,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; @@ -11698,7 +11698,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); -- 2.34.1