Commit f0f798db authored by Chen Huang's avatar Chen Huang Committed by Linus Torvalds

ocfs2: replace simple_strtoull() with kstrtoull()

simple_strtoull() is deprecated in some situation since it does not check
for the range overflow, use kstrtoull() instead.

Link: https://lkml.kernel.org/r/20210526092020.554341-3-chenhuang5@huawei.comSigned-off-by: default avatarChen Huang <chenhuang5@huawei.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <jiangqi903@gmail.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 01f01399
...@@ -1596,12 +1596,13 @@ static ssize_t o2hb_region_start_block_store(struct config_item *item, ...@@ -1596,12 +1596,13 @@ static ssize_t o2hb_region_start_block_store(struct config_item *item,
struct o2hb_region *reg = to_o2hb_region(item); struct o2hb_region *reg = to_o2hb_region(item);
unsigned long long tmp; unsigned long long tmp;
char *p = (char *)page; char *p = (char *)page;
ssize_t ret;
if (reg->hr_bdev) if (reg->hr_bdev)
return -EINVAL; return -EINVAL;
tmp = simple_strtoull(p, &p, 0); ret = kstrtoull(p, 0, &tmp);
if (!p || (*p && (*p != '\n'))) if (ret)
return -EINVAL; return -EINVAL;
reg->hr_start_block = tmp; reg->hr_start_block = tmp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment