summaryrefslogtreecommitdiff
path: root/nandwrite.c
diff options
context:
space:
mode:
Diffstat (limited to 'nandwrite.c')
-rw-r--r--nandwrite.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/nandwrite.c b/nandwrite.c
index 1e30ad1..e691ebd 100644
--- a/nandwrite.c
+++ b/nandwrite.c
@@ -307,6 +307,14 @@ int main(int argc, char * const argv[])
exit (EXIT_FAILURE);
}
+ if (mtdoffset & (meminfo.writesize - 1)) {
+ fprintf(stderr, "The start address is not page-aligned !\n"
+ "The pagesize of this NAND Flash is 0x%x.\n",
+ meminfo.writesize);
+ close(fd);
+ exit(EXIT_FAILURE);
+ }
+
if (autoplace) {
/* Read the current oob info */
if (ioctl (fd, MEMGETOOBSEL, &old_oobinfo) != 0) {