aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card/mmc_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/card/mmc_test.c')
-rw-r--r--drivers/mmc/card/mmc_test.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
index a69df5216274..0c0fc52d42c5 100644
--- a/drivers/mmc/card/mmc_test.c
+++ b/drivers/mmc/card/mmc_test.c
@@ -2849,18 +2849,12 @@ static ssize_t mtf_test_write(struct file *file, const char __user *buf,
2849 struct seq_file *sf = (struct seq_file *)file->private_data; 2849 struct seq_file *sf = (struct seq_file *)file->private_data;
2850 struct mmc_card *card = (struct mmc_card *)sf->private; 2850 struct mmc_card *card = (struct mmc_card *)sf->private;
2851 struct mmc_test_card *test; 2851 struct mmc_test_card *test;
2852 char lbuf[12];
2853 long testcase; 2852 long testcase;
2853 int ret;
2854 2854
2855 if (count >= sizeof(lbuf)) 2855 ret = kstrtol_from_user(buf, count, 10, &testcase);
2856 return -EINVAL; 2856 if (ret)
2857 2857 return ret;
2858 if (copy_from_user(lbuf, buf, count))
2859 return -EFAULT;
2860 lbuf[count] = '\0';
2861
2862 if (strict_strtol(lbuf, 10, &testcase))
2863 return -EINVAL;
2864 2858
2865 test = kzalloc(sizeof(struct mmc_test_card), GFP_KERNEL); 2859 test = kzalloc(sizeof(struct mmc_test_card), GFP_KERNEL);
2866 if (!test) 2860 if (!test)