1 From: Felix Fietkau <nbd@nbd.name>
4 Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 drivers/mtd/devices/block2mtd.c | 9 ++++++---
7 1 file changed, 6 insertions(+), 3 deletions(-)
9 --- a/drivers/mtd/devices/block2mtd.c
10 +++ b/drivers/mtd/devices/block2mtd.c
11 @@ -392,7 +392,7 @@ static int block2mtd_setup2(const char *
12 /* 80 for device, 12 for erase size, 80 for name, 8 for timeout */
13 char buf[80 + 12 + 80 + 8];
18 size_t erase_size = PAGE_SIZE;
19 unsigned long timeout = MTD_DEFAULT_TIMEOUT;
20 @@ -406,7 +406,7 @@ static int block2mtd_setup2(const char *
22 kill_final_newline(str);
24 - for (i = 0; i < 3; i++)
25 + for (i = 0; i < 4; i++)
26 token[i] = strsep(&str, ",");
29 @@ -435,6 +435,9 @@ static int block2mtd_setup2(const char *
30 if (token[2] && (strlen(token[2]) + 1 > 80))
31 pr_err("mtd device name too long\n");
33 + if (token[3] && kstrtoul(token[3], 0, &timeout))
34 + pr_err("invalid timeout\n");
36 add_device(name, erase_size, token[2], timeout);
39 @@ -469,7 +472,7 @@ static int block2mtd_setup(const char *v
42 module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200);
43 -MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=<dev>[,<erasesize>[,<name>]]\"");
44 +MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=<dev>[,<erasesize>[,<name>[,<timeout>]]]\"");
46 static int __init block2mtd_init(void)