aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Thulin <fredrik@thulin.net>2016-06-29 21:44:45 +0200
committerFredrik Thulin <fredrik@thulin.net>2016-06-29 21:44:45 +0200
commitfa79aec3421b5ae27dd2eedc5b959cdc3bbd3689 (patch)
treed11b6e4ac73dea8983fe9dfa88cdb215e0cd8443
parent4866726ff48f4bfe557f425c773a47be49e36f0f (diff)
keystore_erase_sectors: bugfix
-rw-r--r--stm-keystore.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stm-keystore.c b/stm-keystore.c
index 63bf4be..43e22fa 100644
--- a/stm-keystore.c
+++ b/stm-keystore.c
@@ -59,8 +59,8 @@ int keystore_erase_sectors(uint32_t start, uint32_t stop)
{
uint32_t sector;
- if (start > N25Q128_NUM_SECTORS || start < 0) return -2;
- if (stop > N25Q128_NUM_SECTORS || stop < 0 || stop > start) return -3;
+ if (start > N25Q128_NUM_SECTORS) return -2;
+ if (stop > N25Q128_NUM_SECTORS || stop < start) return -3;
for (sector = start; sector <= stop; sector++) {
int timeout = 200; /* times 10ms = 2 seconds timeout */