Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-2.6-microblaze.git] / kernel / kexec_file.c
index 09cc78d..78c0837 100644 (file)
@@ -265,7 +265,7 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd,
                        goto out;
                }
 
-               ima_kexec_cmdline(image->cmdline_buf,
+               ima_kexec_cmdline(kernel_fd, image->cmdline_buf,
                                  image->cmdline_buf_len - 1);
        }
 
@@ -635,6 +635,19 @@ int kexec_locate_mem_hole(struct kexec_buf *kbuf)
        return ret == 1 ? 0 : -EADDRNOTAVAIL;
 }
 
+/**
+ * arch_kexec_locate_mem_hole - Find free memory to place the segments.
+ * @kbuf:                       Parameters for the memory search.
+ *
+ * On success, kbuf->mem will have the start address of the memory region found.
+ *
+ * Return: 0 on success, negative errno on error.
+ */
+int __weak arch_kexec_locate_mem_hole(struct kexec_buf *kbuf)
+{
+       return kexec_locate_mem_hole(kbuf);
+}
+
 /**
  * kexec_add_buffer - place a buffer in a kexec segment
  * @kbuf:      Buffer contents and memory parameters.
@@ -647,7 +660,6 @@ int kexec_locate_mem_hole(struct kexec_buf *kbuf)
  */
 int kexec_add_buffer(struct kexec_buf *kbuf)
 {
-
        struct kexec_segment *ksegment;
        int ret;
 
@@ -675,7 +687,7 @@ int kexec_add_buffer(struct kexec_buf *kbuf)
        kbuf->buf_align = max(kbuf->buf_align, PAGE_SIZE);
 
        /* Walk the RAM ranges and allocate a suitable range for the buffer */
-       ret = kexec_locate_mem_hole(kbuf);
+       ret = arch_kexec_locate_mem_hole(kbuf);
        if (ret)
                return ret;