提交 b4b9bd92 编写于 作者: W Weihang Li 提交者: David S. Miller

net: hns3: modify handling of out of memory in hclge_err.c

Users should be informed if HNS driver failed to allocate memory for
descriptor when handling hw errors. This patch solve above issues.
Signed-off-by: NWeihang Li <liweihang@hisilicon.com>
Signed-off-by: NPeng Li <lipeng321@huawei.com>
Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2253db16
...@@ -1859,7 +1859,7 @@ static int hclge_handle_all_hw_msix_error(struct hclge_dev *hdev, ...@@ -1859,7 +1859,7 @@ static int hclge_handle_all_hw_msix_error(struct hclge_dev *hdev,
if (ret) { if (ret) {
dev_err(dev, "fail(%d) to query msix int status bd num\n", dev_err(dev, "fail(%d) to query msix int status bd num\n",
ret); ret);
return ret; goto out;
} }
mpf_bd_num = le32_to_cpu(desc_bd.data[0]); mpf_bd_num = le32_to_cpu(desc_bd.data[0]);
...@@ -1867,8 +1867,10 @@ static int hclge_handle_all_hw_msix_error(struct hclge_dev *hdev, ...@@ -1867,8 +1867,10 @@ static int hclge_handle_all_hw_msix_error(struct hclge_dev *hdev,
bd_num = max_t(u32, mpf_bd_num, pf_bd_num); bd_num = max_t(u32, mpf_bd_num, pf_bd_num);
desc = kcalloc(bd_num, sizeof(struct hclge_desc), GFP_KERNEL); desc = kcalloc(bd_num, sizeof(struct hclge_desc), GFP_KERNEL);
if (!desc) if (!desc) {
ret = -ENOMEM;
goto out; goto out;
}
ret = hclge_handle_mpf_msix_error(hdev, desc, mpf_bd_num, ret = hclge_handle_mpf_msix_error(hdev, desc, mpf_bd_num,
reset_requests); reset_requests);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册