diff options
author | Liu Yuan <tailai.ly@taobao.com> | 2011-04-01 02:23:49 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2011-05-24 13:06:25 -0400 |
commit | 52f81dbaf1378faf64c3ecea5129cebf826ef126 (patch) | |
tree | cd7be0e965a12f0da8ad42f08414df2b6beebf3c /drivers/infiniband/hw/nes | |
parent | c3af0980ce01dfb8e946990c3ae4c3727b1e9f26 (diff) |
RDMA/nes: Add a check for strict_strtoul()
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>
Diffstat (limited to 'drivers/infiniband/hw/nes')
-rw-r--r-- | drivers/infiniband/hw/nes/nes.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c index 13de1192927c..2d668c69f6d9 100644 --- a/drivers/infiniband/hw/nes/nes.c +++ b/drivers/infiniband/hw/nes/nes.c | |||
@@ -1138,7 +1138,9 @@ static ssize_t nes_store_wqm_quanta(struct device_driver *ddp, | |||
1138 | u32 i = 0; | 1138 | u32 i = 0; |
1139 | struct nes_device *nesdev; | 1139 | struct nes_device *nesdev; |
1140 | 1140 | ||
1141 | strict_strtoul(buf, 0, &wqm_quanta_value); | 1141 | if (kstrtoul(buf, 0, &wqm_quanta_value) < 0) |
1142 | return -EINVAL; | ||
1143 | |||
1142 | list_for_each_entry(nesdev, &nes_dev_list, list) { | 1144 | list_for_each_entry(nesdev, &nes_dev_list, list) { |
1143 | if (i == ee_flsh_adapter) { | 1145 | if (i == ee_flsh_adapter) { |
1144 | nesdev->nesadapter->wqm_quanta = wqm_quanta_value; | 1146 | nesdev->nesadapter->wqm_quanta = wqm_quanta_value; |