From fc4e001de34029ca6451038a351b433677d4f388 Mon Sep 17 00:00:00 2001 From: Øyvind Harboe Date: Mon, 8 Nov 2010 16:53:24 +0100 Subject: stm32: return early upon block write failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit only if we do not have enough ram do we continue. Signed-off-by: Øyvind Harboe --- src/flash/nor/stm32x.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/flash/nor/stm32x.c b/src/flash/nor/stm32x.c index 63a137c1..6b46afc8 100644 --- a/src/flash/nor/stm32x.c +++ b/src/flash/nor/stm32x.c @@ -668,6 +668,9 @@ static int stm32x_write(struct flash_bank *bank, uint8_t *buffer, } } + if ((retval != ERROR_OK) && (retval != ERROR_TARGET_RESOURCE_NOT_AVAILABLE)) + return retval; + while (words_remaining > 0) { uint16_t value; -- cgit v1.2.3