[PATCH 1/2] mtd: create bitflips in the correct page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 drivers/mtd/peb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux