diff options
Diffstat (limited to 'drivers/mtd/mtdchar.c')
-rw-r--r-- | drivers/mtd/mtdchar.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index a0f54e80670c..53563955931b 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -549,6 +549,9 @@ static int mtdchar_blkpg_ioctl(struct mtd_info *mtd, | |||
549 | if (mtd_is_partition(mtd)) | 549 | if (mtd_is_partition(mtd)) |
550 | return -EINVAL; | 550 | return -EINVAL; |
551 | 551 | ||
552 | /* Sanitize user input */ | ||
553 | p.devname[BLKPG_DEVNAMELTH - 1] = '\0'; | ||
554 | |||
552 | return mtd_add_partition(mtd, p.devname, p.start, p.length); | 555 | return mtd_add_partition(mtd, p.devname, p.start, p.length); |
553 | 556 | ||
554 | case BLKPG_DEL_PARTITION: | 557 | case BLKPG_DEL_PARTITION: |