File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 31
31
#include <linux/slab.h>
32
32
#include <linux/major.h>
33
33
34
+ /* Maximum number of comma-separated items in the 'block2mtd=' parameter */
35
+ #define BLOCK2MTD_PARAM_MAX_COUNT 2
36
+
34
37
/* Info for the block device */
35
38
struct block2mtd_dev {
36
39
struct list_head list ;
@@ -381,7 +384,7 @@ static int block2mtd_setup2(const char *val)
381
384
/* 80 for device, 12 for erase size, 80 for name, 8 for timeout */
382
385
char buf [80 + 12 + 80 + 8 ];
383
386
char * str = buf ;
384
- char * token [2 ];
387
+ char * token [BLOCK2MTD_PARAM_MAX_COUNT ];
385
388
char * name ;
386
389
size_t erase_size = PAGE_SIZE ;
387
390
unsigned long timeout = MTD_DEFAULT_TIMEOUT ;
@@ -395,7 +398,7 @@ static int block2mtd_setup2(const char *val)
395
398
strcpy (str , val );
396
399
kill_final_newline (str );
397
400
398
- for (i = 0 ; i < 2 ; i ++ )
401
+ for (i = 0 ; i < BLOCK2MTD_PARAM_MAX_COUNT ; i ++ )
399
402
token [i ] = strsep (& str , "," );
400
403
401
404
if (str ) {
You can’t perform that action at this time.
0 commit comments