@@ -261,8 +261,8 @@ extern int kexec_purgatory_get_set_symbol(struct kimage *image,
unsigned int size, bool get_value);
extern void *kexec_purgatory_get_symbol_addr(struct kimage *image,
const char *name);
-int kexec_update_segment(const char *buffer, unsigned long bufsz,
- unsigned long load_addr, unsigned long memsz);
+int kexec_update_segment(const char *buffer, size_t bufsz,
+ unsigned long load_addr, size_t memsz);
extern void __crash_kexec(struct pt_regs *);
extern void crash_kexec(struct pt_regs *);
int kexec_should_crash(struct task_struct *);
@@ -732,8 +732,8 @@ static struct page *kimage_alloc_page(struct kimage *image,
*
* Return: 0 on success, negative errno on error.
*/
-int kexec_update_segment(const char *buffer, unsigned long bufsz,
- unsigned long load_addr, unsigned long memsz)
+int kexec_update_segment(const char *buffer, size_t bufsz,
+ unsigned long load_addr, size_t memsz)
{
int i;
unsigned long entry;
@@ -763,7 +763,7 @@ int kexec_update_segment(const char *buffer, unsigned long bufsz,
break;
}
if (i == kexec_image->nr_segments) {
- pr_err("Couldn't find segment to update: 0x%lx, size 0x%lx\n",
+ pr_err("Couldn't find segment to update: 0x%lx, size 0x%zx\n",
load_addr, memsz);
return -EINVAL;
}
@@ -777,7 +777,7 @@ int kexec_update_segment(const char *buffer, unsigned long bufsz,
dest = addr;
break;
case IND_INDIRECTION:
- ptr = __va(addr);
+ ptr = __va(entry & PAGE_MASK);
break;
case IND_SOURCE:
/* Shouldn't happen, but verify just to be safe. */