提交 5c25aee5 编写于 作者: A Andy Shevchenko 提交者: Chris Ball

mmc_test: change simple_strtol() to strict_strtol()

It's better to use strict_strtol() to convert user's input and strictly
check it. At least it forbids to interpret wrong input as a 0 and
prevents to run all tests.
Signed-off-by: NAndy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NChris Ball <cjb@laptop.org>
上级 63be54ce
......@@ -2024,9 +2024,10 @@ static ssize_t mmc_test_store(struct device *dev,
{
struct mmc_card *card = mmc_dev_to_card(dev);
struct mmc_test_card *test;
int testcase;
long testcase;
testcase = simple_strtol(buf, NULL, 10);
if (strict_strtol(buf, 10, &testcase))
return -EINVAL;
test = kzalloc(sizeof(struct mmc_test_card), GFP_KERNEL);
if (!test)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册