We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d980efe commit 7be7949Copy full SHA for 7be7949
common/image.c
@@ -451,12 +451,22 @@ phys_size_t getenv_bootm_size(void)
451
void memmove_wd (void *to, void *from, size_t len, ulong chunksz)
452
{
453
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
454
+ if (to > from) {
455
+ from += len;
456
+ to += len;
457
+ }
458
while (len > 0) {
459
size_t tail = (len > chunksz) ? chunksz : len;
460
WATCHDOG_RESET ();
461
462
+ to -= tail;
463
+ from -= tail;
464
465
memmove (to, from, tail);
- to += tail;
- from += tail;
466
+ if (to < from) {
467
+ to += tail;
468
+ from += tail;
469
470
len -= tail;
471
}
472
#else /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
0 commit comments