From b9b872cc44564516b1537eaf4f1c2409f45a0945 Mon Sep 17 00:00:00 2001 From: Andreas Fritiofson Date: Mon, 10 Mar 2014 22:18:57 +0100 Subject: [PATCH 1/1] flash/efm32: Fix bug in odd byte count padding Change-Id: I7fcd152a8501f399c6ac5a85fd62a84c82b030a0 Signed-off-by: Andreas Fritiofson Reviewed-on: http://openocd.zylin.com/2038 Tested-by: jenkins Reviewed-by: Spencer Oliver --- src/flash/nor/efm32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flash/nor/efm32.c b/src/flash/nor/efm32.c index 858bb0a708..6e2ebce257 100644 --- a/src/flash/nor/efm32.c +++ b/src/flash/nor/efm32.c @@ -763,7 +763,7 @@ static int efm32x_write(struct flash_bank *bank, uint8_t *buffer, } LOG_INFO("odd number of bytes to write (%" PRIu32 "), extending to %" PRIu32 " " "and padding with 0xff", old_count, count); - memset(buffer, 0xff, count); + memset(new_buffer, 0xff, count); buffer = memcpy(new_buffer, buffer, old_count); } -- 2.30.2