[Skiboot] [PATCH 03/17] libflash/file: Fix bad subtraction in file erase path
Cyril Bur
cyril.bur at au1.ibm.com
Fri Jul 21 16:35:54 AEST 2017
Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
libflash/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libflash/file.c b/libflash/file.c
index 2d3f27db..5cea3fc5 100644
--- a/libflash/file.c
+++ b/libflash/file.c
@@ -123,7 +123,7 @@ static int file_erase(struct blocklevel_device *bl, uint64_t dst, uint64_t len)
rc = file_write(bl, dst + i, &d, len - i > sizeof(d) ? sizeof(d) : len - i);
if (rc)
return rc;
- i += sizeof(d);
+ i += len - i > sizeof(d) ? sizeof(d) : len - i;
}
return 0;
--
2.13.3
More information about the Skiboot
mailing list