summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/peb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/peb.c')
-rw-r--r--drivers/mtd/peb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/peb.c b/drivers/mtd/peb.c
index c97697f6f9..c35b63f2fd 100644
--- a/drivers/mtd/peb.c
+++ b/drivers/mtd/peb.c
@@ -565,6 +565,8 @@ int mtd_peb_create_bitflips(struct mtd_info *mtd, int pnum, int offset,
if (offset < 0 || offset + len > mtd->erasesize)
return -EINVAL;
+ if (offset % mtd->writesize)
+ return -EINVAL;
if (len <= 0)
return -EINVAL;
if (num_bitflips <= 0)