diff options
author | Andy Shevchenko <andy.shevchenko@gmail.com> | 2010-09-01 09:26:46 +0300 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2010-10-23 21:11:12 +0800 |
commit | 5c25aee5364550d7fa6314886370e76cda18d7e2 (patch) | |
tree | 7eec5d54621c77cfbff0f1fd9ed961a3b95a3631 /drivers/mmc/card | |
parent | 63be54cefa3ae58e1e82036945e3c27f941f5a0d (diff) | |
download | linux-5c25aee5364550d7fa6314886370e76cda18d7e2.tar.gz linux-5c25aee5364550d7fa6314886370e76cda18d7e2.tar.xz |
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: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/card')
-rw-r--r-- | drivers/mmc/card/mmc_test.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c index e27806d6458c..2888fdccd7ad 100644 --- a/drivers/mmc/card/mmc_test.c +++ b/drivers/mmc/card/mmc_test.c @@ -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) |