[Cryptech-Commits] [sw/stm32] 02/03: keystore_erase_sectors: bugfix

git at cryptech.is git at cryptech.is
Wed Jun 29 19:45:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

fredrik at thulin.net pushed a commit to branch master
in repository sw/stm32.

commit fa79aec3421b5ae27dd2eedc5b959cdc3bbd3689
Author: Fredrik Thulin <fredrik at thulin.net>
AuthorDate: Wed Jun 29 21:44:45 2016 +0200

    keystore_erase_sectors: bugfix
---
 stm-keystore.c | 4 ++--
 1 file 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 */



More information about the Commits mailing list