diff mbox

+ mmc_test-change-simple_strtol-to-strict_strtol.patch added to -mm tree

Message ID 201009072230.o87MU3tk010210@imap1.linux-foundation.org (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Andrew Morton Sept. 7, 2010, 10:30 p.m. UTC
None
diff mbox

Patch

diff -puN drivers/mmc/card/mmc_test.c~mmc_test-change-simple_strtol-to-strict_strtol drivers/mmc/card/mmc_test.c
--- a/drivers/mmc/card/mmc_test.c~mmc_test-change-simple_strtol-to-strict_strtol
+++ a/drivers/mmc/card/mmc_test.c
@@ -1937,9 +1937,10 @@  static ssize_t mmc_test_store(struct 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)