diff --git a/src/flash/nor/kinetis.c b/src/flash/nor/kinetis.c index bc39772dd..dc9208cf4 100644 --- a/src/flash/nor/kinetis.c +++ b/src/flash/nor/kinetis.c @@ -731,7 +731,7 @@ static int kinetis_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); }