From de14b5b02f1ceebabca8f79c8e166e673f039aec Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 8 May 2020 10:48:46 -0500 Subject: flash: Correctly signal error on invalid flash read This logic was intended to mirror what is done for "write", but the wrong variable name was repeated twice. --- supervisor/shared/flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'supervisor') diff --git a/supervisor/shared/flash.c b/supervisor/shared/flash.c index 298e7d83e..9f52ddbc4 100644 --- a/supervisor/shared/flash.c +++ b/supervisor/shared/flash.c @@ -88,7 +88,7 @@ static void build_partition(uint8_t *buf, int boot, int type, uint32_t start_blo mp_uint_t flash_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t num_blocks) { if (block_num == 0) { - if (block_num > 1) { + if (num_blocks > 1) { return 1; // error } // fake the MBR so we can decide on our own partition table -- cgit v1.2.3