Skip to content

Commit

Permalink
RDMA/nes: Add a check for strict_strtoul()
Browse files Browse the repository at this point in the history
It should check if strict_strtoul() succeeds before using
'wqm_quanta_value'.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>

[ Convert to kstrtoul() directly while we're here.  - Roland ]

Signed-off-by: Roland Dreier <roland@purestorage.com>
  • Loading branch information
Liu Yuan authored and Roland Dreier committed May 24, 2011
1 parent c3af098 commit 52f81db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/infiniband/hw/nes/nes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,9 @@ static ssize_t nes_store_wqm_quanta(struct device_driver *ddp,
u32 i = 0;
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) {
if (i == ee_flsh_adapter) {
nesdev->nesadapter->wqm_quanta = wqm_quanta_value;
Expand Down

0 comments on commit 52f81db

Please sign in to comment.