diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-03-14 08:07:06 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-03-30 08:23:21 +0200 |
commit | 822a04f43c5286cb1127a6d94b4a4dd147396a5e (patch) | |
tree | 278bd6ef56f673eeb8e5f8355228bc4a8e557193 /drivers/mtd/peb.c | |
parent | 441e9f5a72b245b671118f3e771eb129834a7a34 (diff) | |
download | barebox-822a04f43c5286cb1127a6d94b4a4dd147396a5e.tar.gz barebox-822a04f43c5286cb1127a6d94b4a4dd147396a5e.tar.xz |
mtd: create bitflips in the correct page
In mtd_peb_create_bitflips() buf always points to the first page in a
block. If we want to create bitflips in other pages we have to add the
offset into the block.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd/peb.c')
-rw-r--r-- | drivers/mtd/peb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/peb.c b/drivers/mtd/peb.c index 66227d4ffb..c97697f6f9 100644 --- a/drivers/mtd/peb.c +++ b/drivers/mtd/peb.c @@ -610,7 +610,7 @@ int mtd_peb_create_bitflips(struct mtd_info *mtd, int pnum, int offset, for (i = 0; i < num_bitflips; i++) { int offs; int bit; - u8 *pos = buf; + u8 *pos = buf + offset; if (random) { offs = random32() % len; |