Message ID | ce9ab5790912020633o24dbab61le9ab2d14e0b5177e@mail.gmail.com |
---|---|
State | RFC |
Headers | show |
--- a/flash_lock.c 2009-11-24 19:33:18.000000000 +0530 +++ b/flash_lock.c 2009-11-24 19:33:13.000000000 +0530 @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) } mtdLockInfo.start = ofs; - mtdLockInfo.length = num_sectors * mtdInfo.erasesize; + mtdLockInfo.length = (num_sectors - 1) * mtdInfo.erasesize; if(ioctl(fd, MEMLOCK, &mtdLockInfo)) { fprintf(stderr, "Could not lock MTD device: %s\n", argv[1]); @@ -81,4 +81,3 @@ int main(int argc, char *argv[]) return 0; } -