提交 52f81dba 编写于 作者: L Liu Yuan 提交者: Roland Dreier

RDMA/nes: Add a check for strict_strtoul()

It should check if strict_strtoul() succeeds before using
'wqm_quanta_value'.
Signed-off-by: NLiu Yuan <tailai.ly@taobao.com>

[ Convert to kstrtoul() directly while we're here.  - Roland ]
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 c3af0980
...@@ -1138,7 +1138,9 @@ static ssize_t nes_store_wqm_quanta(struct device_driver *ddp, ...@@ -1138,7 +1138,9 @@ static ssize_t nes_store_wqm_quanta(struct device_driver *ddp,
u32 i = 0; u32 i = 0;
struct nes_device *nesdev; struct nes_device *nesdev;
strict_strtoul(buf, 0, &wqm_quanta_value); if (kstrtoul(buf, 0, &wqm_quanta_value) < 0)
return -EINVAL;
list_for_each_entry(nesdev, &nes_dev_list, list) { list_for_each_entry(nesdev, &nes_dev_list, list) {
if (i == ee_flsh_adapter) { if (i == ee_flsh_adapter) {
nesdev->nesadapter->wqm_quanta = wqm_quanta_value; nesdev->nesadapter->wqm_quanta = wqm_quanta_value;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册