aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/cdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/cdev.c')
-rw-r--r--drivers/mtd/ubi/cdev.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index 45c329694a5e..22547d7a84ea 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -367,6 +367,10 @@ static ssize_t vol_cdev_write(struct file *file, const char __user *buf,
367 return count; 367 return count;
368 } 368 }
369 369
370 /*
371 * We voluntarily do not take into account the skip_check flag
372 * as we want to make sure what we wrote was correctly written.
373 */
370 err = ubi_check_volume(ubi, vol->vol_id); 374 err = ubi_check_volume(ubi, vol->vol_id);
371 if (err < 0) 375 if (err < 0)
372 return err; 376 return err;
@@ -622,6 +626,13 @@ static int verify_mkvol_req(const struct ubi_device *ubi,
622 req->vol_type != UBI_STATIC_VOLUME) 626 req->vol_type != UBI_STATIC_VOLUME)
623 goto bad; 627 goto bad;
624 628
629 if (req->flags & ~UBI_VOL_VALID_FLGS)
630 goto bad;
631
632 if (req->flags & UBI_VOL_SKIP_CRC_CHECK_FLG &&
633 req->vol_type != UBI_STATIC_VOLUME)
634 goto bad;
635
625 if (req->alignment > ubi->leb_size) 636 if (req->alignment > ubi->leb_size)
626 goto bad; 637 goto bad;
627 638