提交 c92b8f62 编写于 作者: H Hao Lan 提交者: Jiantao Xiao

net: hns3: fix getting supported parameter from driver in hclge_set_wol

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I65FSF
CVE: NA

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

The driver should use the supported parameter got from firmware,
not from user,to validate the wol mode.

Fixes: c3c5f044 ("net: hns3: support wake on lan configuration and query")
Signed-off-by: NHao Lan <lanhao@huawei.com>
Signed-off-by: NJiantao Xiao <xiaojiantao1@h-partners.com>
上级 20c27ab8
...@@ -12199,12 +12199,10 @@ static int hclge_set_wol(struct hnae3_handle *handle, ...@@ -12199,12 +12199,10 @@ static int hclge_set_wol(struct hnae3_handle *handle,
struct hclge_vport *vport = hclge_get_vport(handle); struct hclge_vport *vport = hclge_get_vport(handle);
struct hclge_dev *hdev = vport->back; struct hclge_dev *hdev = vport->back;
struct hclge_wol_info *wol_info = &hdev->hw.mac.wol; struct hclge_wol_info *wol_info = &hdev->hw.mac.wol;
u32 wol_supported;
u32 wol_mode; u32 wol_mode;
wol_supported = hclge_wol_mode_from_ethtool(wol->supported);
wol_mode = hclge_wol_mode_from_ethtool(wol->wolopts); wol_mode = hclge_wol_mode_from_ethtool(wol->wolopts);
if (wol_mode & ~wol_supported) if (wol_mode & ~wol_info->wol_support_mode)
return -EINVAL; return -EINVAL;
wol_info->wol_current_mode = wol_mode; wol_info->wol_current_mode = wol_mode;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册