===8<===
From b814922d74bcd1746265fa0fcdb7fc6f4cb1515e Mon Sep 17 00:00:00 2001
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
Date: Wed, 15 Jun 2016 16:32:21 +0900
Subject: [PATCH] arm64: kexec: bugfix
---
arch/arm64/kernel/machine_kexec.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
@@ -124,23 +124,22 @@ static void kexec_list_flush(struct kimage *kimage)
{
kimage_entry_t *entry;
unsigned int flag;
+ void *addr;
- for (entry = &kimage->head, flag = 0; flag != IND_DONE; entry++) {
- void *addr = kmap(phys_to_page(*entry & PAGE_MASK));
-
+ for (entry = &kimage->head; ; entry++) {
flag = *entry & IND_FLAGS;
+ if (flag == IND_DONE)
+ break;
+
+ addr = kmap(phys_to_page(*entry & PAGE_MASK));
switch (flag) {
case IND_INDIRECTION:
entry = (kimage_entry_t *)addr - 1;
- __flush_dcache_area(addr, PAGE_SIZE);
- break;
- case IND_DESTINATION:
- break;
case IND_SOURCE:
__flush_dcache_area(addr, PAGE_SIZE);
break;
- case IND_DONE:
+ case IND_DESTINATION:
break;
default:
BUG();